From 760bca9a9a4639ce29c3be7040214f998c9b47ac Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Tue, 11 Jul 2023 13:43:27 +0900 Subject: [PATCH] fix: use reverse client ID to perform Google login --- .../flutter-native-google-auth/android/app/build.gradle | 2 +- .../lib/screens/login_screen.dart | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/examples/auth/flutter-native-google-auth/android/app/build.gradle b/examples/auth/flutter-native-google-auth/android/app/build.gradle index fdfe23b7bb8..70d7156adbd 100644 --- a/examples/auth/flutter-native-google-auth/android/app/build.gradle +++ b/examples/auth/flutter-native-google-auth/android/app/build.gradle @@ -53,7 +53,7 @@ android { versionCode flutterVersionCode.toInteger() versionName flutterVersionName manifestPlaceholders += [ - 'appAuthRedirectScheme': applicationId + 'appAuthRedirectScheme': 'com.googleusercontent.apps.*account_id*' ] } diff --git a/examples/auth/flutter-native-google-auth/lib/screens/login_screen.dart b/examples/auth/flutter-native-google-auth/lib/screens/login_screen.dart index 1bc255d4cc9..562e3d8376b 100644 --- a/examples/auth/flutter-native-google-auth/lib/screens/login_screen.dart +++ b/examples/auth/flutter-native-google-auth/lib/screens/login_screen.dart @@ -65,13 +65,8 @@ class _LoginScreenState extends State { final clientId = Platform.isIOS ? 'IOS_CLIENT_ID' : 'ANDROID_CLIENT_ID'; - /// Application ID or Bundle ID for your app. - /// If the application ID and Bundle ID is different for Android and iOS, - /// make sure the value here matches the platform you are running on. - const applicationId = 'com.example.myauthapp'; - - /// Fixed value for google login - const redirectUrl = '$applicationId:/google_auth'; + /// Set as reversed DNS form of Google Client ID + `:/` for Google login + final redirectUrl = '${clientId.split('.').reversed.join('.')}:/'; /// Fixed value for google login const discoveryUrl =