From 7be7975226c2884984b07d86fd1e45989ace5126 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Wed, 6 Jul 2022 12:39:40 +0900 Subject: [PATCH 01/16] feat: replace uni_links with app_links to support desktop --- lib/src/supabase_auth.dart | 8 +++++--- pubspec.yaml | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/src/supabase_auth.dart b/lib/src/supabase_auth.dart index d80114ee..f94d3f7b 100644 --- a/lib/src/supabase_auth.dart +++ b/lib/src/supabase_auth.dart @@ -1,9 +1,9 @@ import 'dart:async'; +import 'package:app_links/app_links.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:supabase_flutter/supabase_flutter.dart'; -import 'package:uni_links/uni_links.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -44,6 +44,8 @@ class SupabaseAuth with WidgetsBindingObserver { StreamSubscription? _deeplinkSubscription; + final _appLinks = AppLinks(); + /// Listen to auth change events. /// /// ```dart @@ -218,7 +220,7 @@ class SupabaseAuth with WidgetsBindingObserver { if (!kIsWeb) { // It will handle app links while the app is already started - be it in // the foreground or in the background. - _deeplinkSubscription = uriLinkStream.listen( + _deeplinkSubscription = _appLinks.uriLinkStream.listen( (Uri? uri) { if (uri != null) { _handleDeeplink(uri); @@ -243,7 +245,7 @@ class SupabaseAuth with WidgetsBindingObserver { _initialDeeplinkIsHandled = true; try { - final uri = await getInitialUri(); + final uri = await _appLinks.getInitialAppLink(); if (uri != null) { _handleDeeplink(uri); } diff --git a/pubspec.yaml b/pubspec.yaml index 465ba977..bf8a3920 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -9,12 +9,12 @@ environment: flutter: '>=2.5.0' dependencies: + app_links: ^3.2.0 flutter: sdk: flutter hive: ^2.2.1 hive_flutter: ^1.1.0 supabase: ^0.3.4+1 - uni_links: ^0.5.1 url_launcher: ^6.1.2 dev_dependencies: From bef47786ca3c33cf8e39ed045ae7135014f6cece Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Wed, 6 Jul 2022 15:32:54 +0900 Subject: [PATCH 02/16] feat: update readme to reflect the new changes --- README.md | 224 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 172 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index bac14a48..80d46265 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,8 @@ Supabase is an open source Firebase alternative. We are a service to: | Web | ✅ | ✅ | ✅ | ✅ | ✅ | | Android | ✅ | ✅ | ✅ | ✅ | ✅ | | iOS | ✅ | ✅ | ✅ | ✅ | ✅ | -| macOS | ✅ | | ✅ | ✅ | ✅ | -| Windows | ✅ | | ✅ | ✅ | ✅ | +| macOS | ✅ | ✅ | ✅ | ✅ | ✅ | +| Windows | ✅ | ✅ | ✅ | ✅ | ✅ | | Linux | ✅ | | ✅ | ✅ | ✅ | ## Getting Started @@ -176,66 +176,186 @@ Follow the guide https://supabase.io/docs/guides/auth#third-party-logins ### For Android -Deep Links can have any custom scheme. The downside is that any app can claim a scheme, so make sure yours are as unique as possible, eg. `HST0000001://host.com`. +
+ How to setup + + Deep Links can have any custom scheme. The downside is that any app can claim a scheme, so make sure yours are as unique as possible, eg. `HST0000001://host.com`. + + ```xml + + + + + + + + + + + + + + + + + + ``` + + The `android:host` attribute is optional for Deep Links. + + For more info: https://developer.android.com/training/app-links/deep-linking +
-```xml - +### For iOS + +
+ How to setup + + Custom URL schemes can have... any custom scheme and there is no host specificity, nor entitlements or a hosted file. The downside is that any app can claim any scheme, so make sure yours is as unique as possible, eg. `hst0000001` or `myIncrediblyAwesomeScheme`. + + For **Custom URL schemes** you need to declare the scheme in + `ios/Runner/Info.plist` (or through Xcode's Target Info editor, + under URL Types): + + ```xml - - - - - - - - - - - - - - - -``` + + + + CFBundleURLTypes + + + CFBundleTypeRole + Editor + CFBundleURLSchemes + + [YOUR_SCHEME] + + + + + + + ``` + + This allows for your app to be started from `YOUR_SCHEME://ANYTHING` links. + + For more info: https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app + +
+ +## Windows + +
+ How to setup + + Setting up deeplinks in Windows has few more steps than other plantforms. + + Declare this method in \windows\runner\win32_window.h + ```cpp + // Dispatches link if any. + // This method enables our app to be with a single instance too. + // This is optional but mandatory if you want to catch further links in same app. + bool SendAppLinkToInstance(const std::wstring& title); + ``` + + Add this inclusion at the top of \windows\runner\win32_window.cpp + ```cpp + #include "app_links_windows/app_links_windows_plugin.h" + ``` + + Add this method in \windows\runner\win32_window.cpp + ```cpp + bool Win32Window::SendAppLinkToInstance(const std::wstring& title) { + // Find our exact window + HWND hwnd = ::FindWindow(kWindowClassName, title.c_str()); + + if (hwnd) { + // Dispatch new link to current window + SendAppLink(hwnd); + + // (Optional) Restore our window to front in same state + WINDOWPLACEMENT place = { sizeof(WINDOWPLACEMENT) }; + GetWindowPlacement(hwnd, &place); + switch(place.showCmd) { + case SW_SHOWMAXIMIZED: + ShowWindow(hwnd, SW_SHOWMAXIMIZED); + break; + case SW_SHOWMINIMIZED: + ShowWindow(hwnd, SW_RESTORE); + break; + default: + ShowWindow(hwnd, SW_NORMAL); + break; + } + SetWindowPos(0, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE); + SetForegroundWindow(hwnd); + // END Restore + + // Window has been found, don't create another one. + return true; + } + + return false; + } + ``` + + Add the call to the previous method in `CreateAndShow` + ```cpp + bool Win32Window::CreateAndShow(const std::wstring& title, + const Point& origin, + const Size& size) { + if (SendAppLinkToInstance(title)) { + return false; + } -The `android:host` attribute is optional for Deep Links. + ... + ``` -For more info: https://developer.android.com/training/app-links/deep-linking + At this point, you can register your own scheme. + On Windows, URL protocols are setup in the Windows registry. -### For iOS + This package won't do it for you. -Custom URL schemes can have... any custom scheme and there is no host specificity, nor entitlements or a hosted file. The downside is that any app can claim any scheme, so make sure yours is as unique as possible, eg. `hst0000001` or `myIncrediblyAwesomeScheme`. + You can achieve it with [url_protocol](https://pub.dev/packages/url_protocol) inside you app. -For **Custom URL schemes** you need to declare the scheme in -`ios/Runner/Info.plist` (or through Xcode's Target Info editor, -under URL Types): + The most relevant solution is to include those registry modifications into your installer to allow the unregistration. -```xml - - - - - CFBundleURLTypes - - - CFBundleTypeRole - Editor - CFBundleURLSchemes - - [YOUR_SCHEME] - - - - - - -``` +
+ +## Mac OS -This allows for your app to be started from `YOUR_SCHEME://ANYTHING` links. +
+ How to setup -For more info: https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app + Add this XML chapter in your macos/Runner/Info.plist inside chapter: + + ```xml + + + + + CFBundleURLTypes + + + CFBundleURLName + + sample_name + CFBundleURLSchemes + + + sample + + + + + + + ``` + +
--- From 2cdbe714b2ac54a9db4af5b1d2e23e82884eed3d Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Wed, 6 Jul 2022 17:55:27 +0900 Subject: [PATCH 03/16] fix: updated method channel mock to work with the new deeplink package --- test/supabase_flutter_test.dart | 2 +- test/widget_test.dart | 2 +- test/widget_test_stubs.dart | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/supabase_flutter_test.dart b/test/supabase_flutter_test.dart index 39cc6c99..9b798766 100644 --- a/test/supabase_flutter_test.dart +++ b/test/supabase_flutter_test.dart @@ -9,7 +9,7 @@ void main() { const supabaseKey = ''; setUpAll(() async { - mockUniLink(); + mockAppLink(); // Initialize the Supabase singleton await Supabase.initialize( url: supabaseUrl, diff --git a/test/widget_test.dart b/test/widget_test.dart index 7acedae8..addc7f13 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -10,7 +10,7 @@ void main() { const supabaseKey = ''; setUpAll(() async { - mockUniLink(); + mockAppLink(); // Initialize the Supabase singleton await Supabase.initialize( diff --git a/test/widget_test_stubs.dart b/test/widget_test_stubs.dart index 51eeb8c6..a9bd07eb 100644 --- a/test/widget_test_stubs.dart +++ b/test/widget_test_stubs.dart @@ -53,8 +53,8 @@ class MockLocalStorage extends LocalStorage { } // Register the mock handler for uni_links -void mockUniLink() { - const channel = MethodChannel('uni_links/messages'); +void mockAppLink() { + const channel = MethodChannel('com.llfbandit.app_links/messages'); TestWidgetsFlutterBinding.ensureInitialized(); TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger From 9f6b62b665bf47b9f24ef2412eec142795b92b6e Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sat, 9 Jul 2022 17:25:49 +0900 Subject: [PATCH 04/16] fix: duplicate line and header text --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 80d46265..98804a2e 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ void main() async { ## Authentication -Using authentication can be done easily. Using this package automatically persists the auth state on local storage. +Using this package automatically persists the auth state on local storage. It also helps you handle authentication with deeplink from 3rd party service like Google, Github, Twitter... @@ -174,7 +174,7 @@ The redirect callback url should have this format `[YOUR_SCHEME]://[YOUR_AUTH_HO Follow the guide https://supabase.io/docs/guides/auth#third-party-logins -### For Android +#### For Android
How to setup @@ -208,7 +208,7 @@ Follow the guide https://supabase.io/docs/guides/auth#third-party-logins For more info: https://developer.android.com/training/app-links/deep-linking
-### For iOS +#### For iOS
How to setup @@ -246,7 +246,7 @@ Follow the guide https://supabase.io/docs/guides/auth#third-party-logins
-## Windows +#### For Windows
How to setup @@ -325,7 +325,7 @@ Follow the guide https://supabase.io/docs/guides/auth#third-party-logins
-## Mac OS +#### For Mac OS
How to setup From 4c634d1882d1bdade86a9dbf0e6ea250aa4c998f Mon Sep 17 00:00:00 2001 From: Tyler <18113850+dshukertjr@users.noreply.github.com> Date: Sat, 9 Jul 2022 17:26:21 +0900 Subject: [PATCH 05/16] Update lib/src/supabase_auth.dart Co-authored-by: Bruno D'Luka <45696119+bdlukaa@users.noreply.github.com> --- lib/src/supabase_auth.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/src/supabase_auth.dart b/lib/src/supabase_auth.dart index f94d3f7b..ec2a9463 100644 --- a/lib/src/supabase_auth.dart +++ b/lib/src/supabase_auth.dart @@ -28,8 +28,9 @@ class SupabaseAuth with WidgetsBindingObserver { Future get accessToken => _localStorage.accessToken(); /// Returns when the initial session recovery is done. - /// Can be used to determine whether a user is signed in or not upon - /// initial app launch. + /// + /// Can be used to determine whether a user is signed in upon initial + /// app launch. Future get initialSession => _initialSessionCompleter.future; final Completer _initialSessionCompleter = Completer(); From f76f45d7cf4a8f181a90a2470f7a68b456d0e27a Mon Sep 17 00:00:00 2001 From: Tyler <18113850+dshukertjr@users.noreply.github.com> Date: Sat, 9 Jul 2022 17:26:29 +0900 Subject: [PATCH 06/16] Update README.md Co-authored-by: Bruno D'Luka <45696119+bdlukaa@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 98804a2e..fa808716 100644 --- a/README.md +++ b/README.md @@ -251,7 +251,7 @@ Follow the guide https://supabase.io/docs/guides/auth#third-party-logins
How to setup - Setting up deeplinks in Windows has few more steps than other plantforms. + Setting up deeplinks in Windows has few more steps than other platforms. [Learn more](https://pub.dev/packages/app_links#windows) Declare this method in \windows\runner\win32_window.h ```cpp From f781537dfffa4cb0a95aca54413bbba11ae5dc96 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sat, 9 Jul 2022 17:29:16 +0900 Subject: [PATCH 07/16] fix: formatting --- lib/src/supabase_auth.dart | 2 +- pubspec_overrides.yaml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 pubspec_overrides.yaml diff --git a/lib/src/supabase_auth.dart b/lib/src/supabase_auth.dart index ec2a9463..d5983e54 100644 --- a/lib/src/supabase_auth.dart +++ b/lib/src/supabase_auth.dart @@ -29,7 +29,7 @@ class SupabaseAuth with WidgetsBindingObserver { /// Returns when the initial session recovery is done. /// - /// Can be used to determine whether a user is signed in upon initial + /// Can be used to determine whether a user is signed in upon initial /// app launch. Future get initialSession => _initialSessionCompleter.future; final Completer _initialSessionCompleter = Completer(); diff --git a/pubspec_overrides.yaml b/pubspec_overrides.yaml new file mode 100644 index 00000000..e1246242 --- /dev/null +++ b/pubspec_overrides.yaml @@ -0,0 +1,3 @@ +dependency_overrides: + supabase: + path: ../supabase-dart From de64986b3fe4a54474684609a9e22db994e1fa01 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sat, 9 Jul 2022 17:33:41 +0900 Subject: [PATCH 08/16] fix: removed pubspec_overrides.yaml --- pubspec_overrides.yaml | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 pubspec_overrides.yaml diff --git a/pubspec_overrides.yaml b/pubspec_overrides.yaml deleted file mode 100644 index e1246242..00000000 --- a/pubspec_overrides.yaml +++ /dev/null @@ -1,3 +0,0 @@ -dependency_overrides: - supabase: - path: ../supabase-dart From db3fcd987f69e9f4602584615660ba5c2824c656 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Wed, 6 Jul 2022 12:39:40 +0900 Subject: [PATCH 09/16] fix: run rebase from main --- lib/src/supabase_auth.dart | 8 +++++--- pubspec.yaml | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/src/supabase_auth.dart b/lib/src/supabase_auth.dart index 1b8162a0..610d4c1f 100644 --- a/lib/src/supabase_auth.dart +++ b/lib/src/supabase_auth.dart @@ -1,9 +1,9 @@ import 'dart:async'; +import 'package:app_links/app_links.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:supabase_flutter/supabase_flutter.dart'; -import 'package:uni_links/uni_links.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -44,6 +44,8 @@ class SupabaseAuth with WidgetsBindingObserver { StreamSubscription? _deeplinkSubscription; + final _appLinks = AppLinks(); + /// Listen to auth change events. /// /// ```dart @@ -218,7 +220,7 @@ class SupabaseAuth with WidgetsBindingObserver { if (!kIsWeb) { // It will handle app links while the app is already started - be it in // the foreground or in the background. - _deeplinkSubscription = uriLinkStream.listen( + _deeplinkSubscription = _appLinks.uriLinkStream.listen( (Uri? uri) { if (uri != null) { _handleDeeplink(uri); @@ -243,7 +245,7 @@ class SupabaseAuth with WidgetsBindingObserver { _initialDeeplinkIsHandled = true; try { - final uri = await getInitialUri(); + final uri = await _appLinks.getInitialAppLink(); if (uri != null) { _handleDeeplink(uri); } diff --git a/pubspec.yaml b/pubspec.yaml index 4604934f..21353ea7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -9,12 +9,12 @@ environment: flutter: '>=2.5.0' dependencies: + app_links: ^3.2.0 flutter: sdk: flutter hive: ^2.2.1 hive_flutter: ^1.1.0 supabase: ^0.3.6 - uni_links: ^0.5.1 url_launcher: ^6.1.2 dev_dependencies: From a1acc09c9455c38dc7b99f3335d4a13d4c1e8883 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Wed, 6 Jul 2022 15:32:54 +0900 Subject: [PATCH 10/16] feat: update readme to reflect the new changes --- README.md | 224 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 172 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index e4eaddae..b0c8a8b6 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,8 @@ Supabase is an open source Firebase alternative. We are a service to: | Web | ✅ | ✅ | ✅ | ✅ | ✅ | | Android | ✅ | ✅ | ✅ | ✅ | ✅ | | iOS | ✅ | ✅ | ✅ | ✅ | ✅ | -| macOS | ✅ | | ✅ | ✅ | ✅ | -| Windows | ✅ | | ✅ | ✅ | ✅ | +| macOS | ✅ | ✅ | ✅ | ✅ | ✅ | +| Windows | ✅ | ✅ | ✅ | ✅ | ✅ | | Linux | ✅ | | ✅ | ✅ | ✅ | ## Getting Started @@ -385,66 +385,186 @@ Follow the guide https://supabase.io/docs/guides/auth#third-party-logins ### For Android -Deep Links can have any custom scheme. The downside is that any app can claim a scheme, so make sure yours are as unique as possible, eg. `HST0000001://host.com`. +
+ How to setup + + Deep Links can have any custom scheme. The downside is that any app can claim a scheme, so make sure yours are as unique as possible, eg. `HST0000001://host.com`. + + ```xml + + + + + + + + + + + + + + + + + + ``` + + The `android:host` attribute is optional for Deep Links. + + For more info: https://developer.android.com/training/app-links/deep-linking +
-```xml - +### For iOS + +
+ How to setup + + Custom URL schemes can have... any custom scheme and there is no host specificity, nor entitlements or a hosted file. The downside is that any app can claim any scheme, so make sure yours is as unique as possible, eg. `hst0000001` or `myIncrediblyAwesomeScheme`. + + For **Custom URL schemes** you need to declare the scheme in + `ios/Runner/Info.plist` (or through Xcode's Target Info editor, + under URL Types): + + ```xml - - - - - - - - - - - - - - - -``` + + + + CFBundleURLTypes + + + CFBundleTypeRole + Editor + CFBundleURLSchemes + + [YOUR_SCHEME] + + + + + + + ``` + + This allows for your app to be started from `YOUR_SCHEME://ANYTHING` links. + + For more info: https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app + +
+ +## Windows + +
+ How to setup + + Setting up deeplinks in Windows has few more steps than other plantforms. + + Declare this method in \windows\runner\win32_window.h + ```cpp + // Dispatches link if any. + // This method enables our app to be with a single instance too. + // This is optional but mandatory if you want to catch further links in same app. + bool SendAppLinkToInstance(const std::wstring& title); + ``` + + Add this inclusion at the top of \windows\runner\win32_window.cpp + ```cpp + #include "app_links_windows/app_links_windows_plugin.h" + ``` + + Add this method in \windows\runner\win32_window.cpp + ```cpp + bool Win32Window::SendAppLinkToInstance(const std::wstring& title) { + // Find our exact window + HWND hwnd = ::FindWindow(kWindowClassName, title.c_str()); + + if (hwnd) { + // Dispatch new link to current window + SendAppLink(hwnd); + + // (Optional) Restore our window to front in same state + WINDOWPLACEMENT place = { sizeof(WINDOWPLACEMENT) }; + GetWindowPlacement(hwnd, &place); + switch(place.showCmd) { + case SW_SHOWMAXIMIZED: + ShowWindow(hwnd, SW_SHOWMAXIMIZED); + break; + case SW_SHOWMINIMIZED: + ShowWindow(hwnd, SW_RESTORE); + break; + default: + ShowWindow(hwnd, SW_NORMAL); + break; + } + SetWindowPos(0, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE); + SetForegroundWindow(hwnd); + // END Restore + + // Window has been found, don't create another one. + return true; + } + + return false; + } + ``` + + Add the call to the previous method in `CreateAndShow` + ```cpp + bool Win32Window::CreateAndShow(const std::wstring& title, + const Point& origin, + const Size& size) { + if (SendAppLinkToInstance(title)) { + return false; + } -The `android:host` attribute is optional for Deep Links. + ... + ``` -For more info: https://developer.android.com/training/app-links/deep-linking + At this point, you can register your own scheme. + On Windows, URL protocols are setup in the Windows registry. -### For iOS + This package won't do it for you. -Custom URL schemes can have... any custom scheme and there is no host specificity, nor entitlements or a hosted file. The downside is that any app can claim any scheme, so make sure yours is as unique as possible, eg. `hst0000001` or `myIncrediblyAwesomeScheme`. + You can achieve it with [url_protocol](https://pub.dev/packages/url_protocol) inside you app. -For **Custom URL schemes** you need to declare the scheme in -`ios/Runner/Info.plist` (or through Xcode's Target Info editor, -under URL Types): + The most relevant solution is to include those registry modifications into your installer to allow the unregistration. -```xml - - - - - CFBundleURLTypes - - - CFBundleTypeRole - Editor - CFBundleURLSchemes - - [YOUR_SCHEME] - - - - - - -``` +
+ +## Mac OS -This allows for your app to be started from `YOUR_SCHEME://ANYTHING` links. +
+ How to setup -For more info: https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app + Add this XML chapter in your macos/Runner/Info.plist inside chapter: + + ```xml + + + + + CFBundleURLTypes + + + CFBundleURLName + + sample_name + CFBundleURLSchemes + + + sample + + + + + + + ``` + +
--- From e58ecd98ffa7b03cb15dddae2ecde4a8fd1daf5b Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Wed, 6 Jul 2022 17:55:27 +0900 Subject: [PATCH 11/16] fix: updated method channel mock to work with the new deeplink package --- test/supabase_flutter_test.dart | 2 +- test/widget_test.dart | 2 +- test/widget_test_stubs.dart | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/supabase_flutter_test.dart b/test/supabase_flutter_test.dart index 6170a40f..24490ddd 100644 --- a/test/supabase_flutter_test.dart +++ b/test/supabase_flutter_test.dart @@ -8,7 +8,7 @@ void main() { const supabaseKey = ''; setUpAll(() async { - mockUniLink(); + mockAppLink(); // Initialize the Supabase singleton await Supabase.initialize( url: supabaseUrl, diff --git a/test/widget_test.dart b/test/widget_test.dart index 7acedae8..addc7f13 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -10,7 +10,7 @@ void main() { const supabaseKey = ''; setUpAll(() async { - mockUniLink(); + mockAppLink(); // Initialize the Supabase singleton await Supabase.initialize( diff --git a/test/widget_test_stubs.dart b/test/widget_test_stubs.dart index 51eeb8c6..a9bd07eb 100644 --- a/test/widget_test_stubs.dart +++ b/test/widget_test_stubs.dart @@ -53,8 +53,8 @@ class MockLocalStorage extends LocalStorage { } // Register the mock handler for uni_links -void mockUniLink() { - const channel = MethodChannel('uni_links/messages'); +void mockAppLink() { + const channel = MethodChannel('com.llfbandit.app_links/messages'); TestWidgetsFlutterBinding.ensureInitialized(); TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger From 38331a5aa3be0816c4b29696b68e8630a3928420 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sat, 9 Jul 2022 17:25:49 +0900 Subject: [PATCH 12/16] fix: duplicate line and header text --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b0c8a8b6..0826f618 100644 --- a/README.md +++ b/README.md @@ -279,7 +279,7 @@ class _MyWidgetState extends State { ## Authentication -Using authentication can be done easily. Using this package automatically persists the auth state on local storage. +Using this package automatically persists the auth state on local storage. It also helps you handle authentication with deeplink from 3rd party service like Google, Github, Twitter... @@ -383,7 +383,7 @@ The redirect callback url should have this format `[YOUR_SCHEME]://[YOUR_AUTH_HO Follow the guide https://supabase.io/docs/guides/auth#third-party-logins -### For Android +#### For Android
How to setup @@ -417,7 +417,7 @@ Follow the guide https://supabase.io/docs/guides/auth#third-party-logins For more info: https://developer.android.com/training/app-links/deep-linking
-### For iOS +#### For iOS
How to setup @@ -455,7 +455,7 @@ Follow the guide https://supabase.io/docs/guides/auth#third-party-logins
-## Windows +#### For Windows
How to setup @@ -534,7 +534,7 @@ Follow the guide https://supabase.io/docs/guides/auth#third-party-logins
-## Mac OS +#### For Mac OS
How to setup From 52f7e24d176b037aea031279eab3d2d4329d6ad3 Mon Sep 17 00:00:00 2001 From: Tyler <18113850+dshukertjr@users.noreply.github.com> Date: Sat, 9 Jul 2022 17:26:21 +0900 Subject: [PATCH 13/16] Update lib/src/supabase_auth.dart Co-authored-by: Bruno D'Luka <45696119+bdlukaa@users.noreply.github.com> --- lib/src/supabase_auth.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/src/supabase_auth.dart b/lib/src/supabase_auth.dart index 610d4c1f..eeff4b72 100644 --- a/lib/src/supabase_auth.dart +++ b/lib/src/supabase_auth.dart @@ -28,8 +28,9 @@ class SupabaseAuth with WidgetsBindingObserver { Future get accessToken => _localStorage.accessToken(); /// Returns when the initial session recovery is done. - /// Can be used to determine whether a user is signed in or not upon - /// initial app launch. + /// + /// Can be used to determine whether a user is signed in upon initial + /// app launch. Future get initialSession => _initialSessionCompleter.future; final Completer _initialSessionCompleter = Completer(); From 921290432a108229620b010ce77bf38c44180d75 Mon Sep 17 00:00:00 2001 From: Tyler <18113850+dshukertjr@users.noreply.github.com> Date: Sat, 9 Jul 2022 17:26:29 +0900 Subject: [PATCH 14/16] Update README.md Co-authored-by: Bruno D'Luka <45696119+bdlukaa@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0826f618..003129d2 100644 --- a/README.md +++ b/README.md @@ -460,7 +460,7 @@ Follow the guide https://supabase.io/docs/guides/auth#third-party-logins
How to setup - Setting up deeplinks in Windows has few more steps than other plantforms. + Setting up deeplinks in Windows has few more steps than other platforms. [Learn more](https://pub.dev/packages/app_links#windows) Declare this method in \windows\runner\win32_window.h ```cpp From 6eecb1d527494de179adf30f52f6a059a60c4081 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sat, 9 Jul 2022 17:29:16 +0900 Subject: [PATCH 15/16] fix: formatting --- lib/src/supabase_auth.dart | 2 +- pubspec_overrides.yaml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 pubspec_overrides.yaml diff --git a/lib/src/supabase_auth.dart b/lib/src/supabase_auth.dart index eeff4b72..ea51938d 100644 --- a/lib/src/supabase_auth.dart +++ b/lib/src/supabase_auth.dart @@ -29,7 +29,7 @@ class SupabaseAuth with WidgetsBindingObserver { /// Returns when the initial session recovery is done. /// - /// Can be used to determine whether a user is signed in upon initial + /// Can be used to determine whether a user is signed in upon initial /// app launch. Future get initialSession => _initialSessionCompleter.future; final Completer _initialSessionCompleter = Completer(); diff --git a/pubspec_overrides.yaml b/pubspec_overrides.yaml new file mode 100644 index 00000000..e1246242 --- /dev/null +++ b/pubspec_overrides.yaml @@ -0,0 +1,3 @@ +dependency_overrides: + supabase: + path: ../supabase-dart From 72856040f6dcb81960260d7d22b9084cfcca10de Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sat, 9 Jul 2022 17:33:41 +0900 Subject: [PATCH 16/16] fix: removed pubspec_overrides.yaml --- pubspec_overrides.yaml | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 pubspec_overrides.yaml diff --git a/pubspec_overrides.yaml b/pubspec_overrides.yaml deleted file mode 100644 index e1246242..00000000 --- a/pubspec_overrides.yaml +++ /dev/null @@ -1,3 +0,0 @@ -dependency_overrides: - supabase: - path: ../supabase-dart