Closed kokihoon closed 2 months ago
I guess this is the response from the apple support. Please use the issue template and not just paste the response without any context or code example.
I guess you are using signInWithOAuth()
. Please try setting authScreenLaunchMode
to LaunchMode.inAppView
and provide the context
.
Hi, @kokihoon just like to ask. after the email verification does it redirect you back to your app or create another instance?
I'm having this issue as well and inAppView
is sadly not working for me.
To provide further details:
I've been using sign in with provider for Apple and Google. Just a couple days ago Apple rejected my latest build because I was using externalApplication
for my launch mode.
I just tested inAppView
. I'm able to auth with apple as expected, but then I fail to redirect back to my app (I get stuck on my redirect page instead of the universal link brining me back to the app) and my logs show the following error:
flutter: PlatformException(Error, Error while launching https://ekcvtfaavlzpyfxixazo.supabase.co/auth/v1/authorize?provider=apple&redirect_to=https%3A%2F%2Fdribblegame.com%2Fmobile_login.html%3Fanon_id%3Db1fed09a-efbd-44e8-be48-3c9efb3829cc, null, null)
flutter:
flutter: PlatformException(Error, Error while launching https://ekcvtfaavlzpyfxixazo.supabase.co/auth/v1/authorize?provider=apple&redirect_to=https%3A%2F%2Fdribblegame.com%2Fmobile_login.html, null, null)
flutter:
#0 UrlLauncherApi.openUrlInSafariViewController (package:url_launcher_ios/src/messages.g.dart:95:7)
<asynchronous suspension>
#1 GoTrueClientSignInProvider.signInWithOAuth (package:supabase_flutter/src/supabase_auth.dart:368:22)
<asynchronous suspension>
#2 AuthManager._signInWithProvider (package:dribble_game_mobile/clients/auth_manager.dart:136:22)
<asynchronous suspension>
I reverted back to externalApplication
and everything goes back to working properly. Any ideas?
I resolved the problem by using native sign in instead of inAppView
. The auth flow is MUCH faster for the user and a lot less complicated/finnicky on the dev side, I'd highly recommend it!!!
Here's a supa blog post with the instructions for other readers facing this problem: https://supabase.com/blog/supabase-auth-sso-pkce#native-apple-login-on-ios#native-apple-login-on-ios
Note that the blog post is slightly incomplete though, you need to also add the "sign in with apple" capability to your app from XCode: https://stackoverflow.com/a/62897820
caseycrogers
Unlike apple, there's urrently no native sign in support for Kakao. I think this can only be resolved by implementing native sign in for Kakao auth provider. By using the official kakao-flutter sdk, it's possible to retrieve id token which can be used for supabase auth provider sign in.
Closing as native Kakao login is now supported https://github.com/supabase/supabase-flutter/pull/922
Guideline 4.0 - Design
We still noticed that the user is taken to the default web browser to sign in or register for an account, which provides a poor user experience. (Kakao)
Next Steps
To resolve this issue, please revise your app to enable users to sign in or register for an account in the app.
You may also choose to implement the Safari View Controller API to display web content within your app. The Safari View Controller allows the display of a URL and inspection of the certificate from an embedded browser in an app so that customers can verify the webpage URL and SSL certificate to confirm they are entering their sign in credentials into a legitimate page.
Please see attached screenshot for details.