You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I configure the default Firebase app and use this for analytics etc.
I am configuring and using a secondary Firebase app and using this for my authentication as I want to access users (and DB) from this secondary Firebase project.
I am able to do this successfully for FUIEmailAuth (and probably FUIPhoneAuth) as they have constructors that allow an authUI instance to be specified (instead of using the default one). However the FUIGoogleAuth, FUIFacebookAuth, and FUITwitterAuth providers do not seem to allow for a custom authUI, and use the default firebase app details.
Steps to reproduce:
See the Relevant code
Observed Results:
Running the relevant code below will work for email sign in. For Google sign in we will assert with an error similar to:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Your app is missing support for the following URL schemes: com.googleusercontent.apps.blahblah'
The actual URL scheme in the log matches the scheme for the default app, rather than the secondary app
Expected Results:
I would hope that an authUI parameter could be added to the other providers and their code updated to optionally use that, rather than always the default.
Relevant Code:
//Setup the default firebase app FirebaseApp.configure()////Set up a secondary firebase app that we want to authenticate against//Acutal ID's etc altered for privacy reasons//letsecondaryOptions=FirebaseOptions(googleAppID:"myAppId", gcmSenderID:"mySenderID")
secondaryOptions.bundleID ="myBundleID"
secondaryOptions.apiKey ="myAPIKey"
secondaryOptions.clientID ="myClientID"
secondaryOptions.databaseURL ="myDbUrl"
secondaryOptions.storageBucket ="myBucket"// Configure an alternative FIRApp.FirebaseApp.configure(name:"secondary", options: secondaryOptions)// Retrieve a previous created named app.
guard let secondary =FirebaseApp.app(name:"secondary")else{assert(false,"Could not retrieve secondary app")}// Retrieve the auth for the secondary appletsecondaryAuth=Auth.auth(app: secondary)
authUI =FUIAuth(uiWith: secondaryAuth)// We need to adopt a FUIAuthDelegate protocol to receive callback
authUI?.delegate =self//Set up providersletproviders:[FUIAuthProvider]=[FUIGoogleAuth(),//Aaargh - I can't seem to specify an authUI instance!FUIEmailAuth(authAuthUI: authUI, signInMethod: EmailPasswordAuthSignInMethod, forceSameDevice: false, allowNewEmailAccounts: true, actionCodeSetting:ActionCodeSettings())]
authUI?.providers = providers
The text was updated successfully, but these errors were encountered:
Environment
Describe the problem:
I configure the default Firebase app and use this for analytics etc.
I am configuring and using a secondary Firebase app and using this for my authentication as I want to access users (and DB) from this secondary Firebase project.
I am able to do this successfully for FUIEmailAuth (and probably FUIPhoneAuth) as they have constructors that allow an authUI instance to be specified (instead of using the default one). However the FUIGoogleAuth, FUIFacebookAuth, and FUITwitterAuth providers do not seem to allow for a custom authUI, and use the default firebase app details.
Steps to reproduce:
See the Relevant code
Observed Results:
Running the relevant code below will work for email sign in. For Google sign in we will assert with an error similar to:
The actual URL scheme in the log matches the scheme for the default app, rather than the secondary app
Expected Results:
I would hope that an authUI parameter could be added to the other providers and their code updated to optionally use that, rather than always the default.
Relevant Code:
The text was updated successfully, but these errors were encountered: