Ad

Flutter::iOS Multiple Schemes Different Firebase Projects

I am having multiple env scheme setup dev and prod and consequently I have two firebase projects for each env. I set up two schemes prod and dev on iOS and did follow instructions step by step as of the link https://www.tengio.com/blog/multiple-firebase-environments-with-flutter/ However when I try to sign in using google single signin I get this error Unhandled Exception: PlatformException(google_sign_in, Your app is missing support for the following URL schemes What I am missing?

Error Log:

[VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: PlatformException(google_sign_in, Your app is missing support for the following URL schemes: com.googleusercontent.apps.xxxxxx-yyyyy, NSInvalidArgumentException)
#0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
#1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33)
<asynchronous suspension>
#2      MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:349:48)
#3      MethodChannelGoogleSignIn.signIn (package:google_sign_in_platform_interface/src/method_channel_google_sign_in.dart:45:10)
#4      GoogleSignIn._callMethod (package:google_sign_in/google_sign_in.dart:227:42)
<asynchronous suspension>
#5      GoogleSignIn._addMethodCall.<anonymous closure> (package:google_sign_in/google_sign_in.dart:291:16)
#6      _rootRunUnary (dart:async/zone.dart:1134:38)
#7      _CustomZone.runUnary (dart:async/zon<…>
Lost connection to device.

Thanks

Ad

Answer

I think You need to get the REVERSED_CLIENT_ID Found in the google-services.json or GoogleService-Info.plist and add it in XCode in URL Schemes enter image description here You can check this link for more details

https://firebase.google.com/docs/auth/ios/google-signin

Ad
source: stackoverflow.com
Ad