Flutter :: iOS多个方案不同的Firebase项目

问题描述 投票:1回答:1

我有多个环境方案设置dev和prod,因此每个环境都有两个firebase项目。我在iOS上设置了两个方案prod和dev,并确实按照链接https://www.tengio.com/blog/multiple-firebase-environments-with-flutter/的说明逐步进行操作。但是,当我尝试使用Google单一登录进行登录时,出现此错误Unhandled Exception: PlatformException(google_sign_in, Your app is missing support for the following URL schemes我缺少了什么?

错误日志:

[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.

谢谢

ios flutter development-environment production-environment
1个回答
2
投票

我认为您需要获取REVERSED_CLIENT_ID在google-services.json或GoogleService-Info.plist中找到并将其添加到URL方案的XCode中enter image description here您可以检查此链接以获取更多详细信息

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

© www.soinside.com 2019 - 2024. All rights reserved.