Joel Denke
05/22/2023, 8:47 AMval authProvider = GoogleAuthProvider.credential(token, accessToken)
val auth = firebaseAuth.signInWithCredential(authProvider)
However in every single example they mention using GoogleSignInClient from Google Play Service, at same time they say not need google play services.
How do I login multiplatform with token/accessToken? I can use actual/expect redirect to webview or whatever if needed, but not sure how to achieve this.
Anyone implemented Google SSO with Firebase Auth in Kotlin Multiplatform?A
05/22/2023, 11:51 PMGoogleSignInClient
to generate idToken
and pass to shared. On iOS will be similar.Joel Denke
05/23/2023, 6:38 AMJoel Denke
05/23/2023, 6:40 AMA
05/23/2023, 7:27 AMJoel Denke
05/23/2023, 7:34 AMA
05/23/2023, 10:56 PMRaed Ghazal
11/26/2023, 6:30 AMJoel Denke
11/26/2023, 8:41 AMRaed Ghazal
11/26/2023, 8:42 AMRaed Ghazal
11/26/2023, 8:43 AMRaed Ghazal
11/26/2023, 8:43 AMJoel Denke
11/26/2023, 8:47 AMRaed Ghazal
11/26/2023, 8:48 AMJoel Denke
11/26/2023, 8:49 AMJoel Denke
11/26/2023, 8:50 AMfunc makeUIViewController(context: Context) -> some UIViewController {
return ScreenProvider.shared.createMainScreenController(onLogin: login)
}
Pretty much this in Swift ui.Joel Denke
11/26/2023, 8:51 AMGIDSignIn.sharedInstance.signIn(withPresenting: presentingViewController) { result, error in
Joel Denke
11/26/2023, 8:54 AMJoel Denke
11/26/2023, 8:59 AMRaed Ghazal
11/26/2023, 9:25 AMJoel Denke
11/26/2023, 9:40 AMJoel Denke
11/26/2023, 9:44 AMJoel Denke
11/26/2023, 9:46 AMJoel Denke
11/26/2023, 10:42 AMJoel Denke
11/26/2023, 11:12 AMRaed Ghazal
11/26/2023, 11:17 AMRaed Ghazal
11/26/2023, 11:18 AMRaed Ghazal
11/26/2023, 11:19 AMViktor Nyblom
02/09/2024, 1:49 PMval idToken = gidSignInResult?.user?.idToken?.tokenString
val accessToken = gidSignInResult?.user?.accessToken?.tokenString
val credential = GoogleAuthProvider.credential(idToken, accessToken)
This credential can then be used with Firebase to sign in as you normally would:
Firebase.auth.signInWithCredential(credential)
Joel Denke
02/09/2024, 1:52 PMViktor Nyblom
02/09/2024, 1:54 PMJoel Denke
02/09/2024, 1:55 PMJoel Denke
02/09/2024, 1:56 PMcocoapods {
version = "1.0"
name = "MyPods"
summary = "App CocoaPods"
homepage = "<https://github.com/JetBrains/kotlin>"
ios.deploymentTarget = "17.2"
pod("GoogleSignIn") {
version = "7.0.0"
}
//pod("FirebaseCore")
//pod("FirebaseAuth")
}
Into Kotlin. But then getting duplicated link issues instead or other oddness ๐Viktor Nyblom
02/09/2024, 1:59 PMJoel Denke
02/09/2024, 2:03 PMJoel Denke
02/09/2024, 2:17 PMld: warning: Could not find or use auto-linked framework 'FirebaseAuth': framework 'FirebaseAuth' not found
ld: warning: Could not find or use auto-linked framework 'FirebaseCore': framework 'FirebaseCore' not found
ld: warning: Could not find or use auto-linked framework 'FirebaseFirestore': framework 'FirebaseFirestore' not found
ld: warning: Could not find or use auto-linked framework 'GoogleSignIn': framework 'GoogleSignIn' not found
ld: Undefined symbols:
_FIRAuthErrorDomain, referenced from:
_cocoapods_FirebaseAuth_FIRAuthErrorDomain_getter_wrapper0 in MyAppKt[arm64][2714](libdev.gitlive:firebase-auth-cinterop-FirebaseAuth-cache.a.o)
_FIRAuthStateDidChangeInternalNotification, referenced from:
firebase::firestore::credentials::FirebaseAuthCredentialsProvider::FirebaseAuthCredentialsProvider(FIRApp*, id<FIRAuthInterop>) in FirebaseFirestoreInternal[arm64][72](firebase_auth_credentials_provider_apple.o)
_FIRAuthStateDidChangeInternalNotificationAppKey, referenced from:
Eury Perez
03/11/2024, 9:55 AMJoel Denke
03/11/2024, 6:52 PM