Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/122.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios React Native:Exception';您的应用程序缺少对以下URL方案的支持[#id.apps.googleusercontent.com]';_Ios_Exception_React Native_Google Signin_Url Scheme - Fatal编程技术网

Ios React Native:Exception';您的应用程序缺少对以下URL方案的支持[#id.apps.googleusercontent.com]';

Ios React Native:Exception';您的应用程序缺少对以下URL方案的支持[#id.apps.googleusercontent.com]';,ios,exception,react-native,google-signin,url-scheme,Ios,Exception,React Native,Google Signin,Url Scheme,我试图在我的react原生应用程序中集成GoogleSignin 但我得到了一个例外: “您的应用缺少对以下URL方案的支持[#id.apps.googleusercontent.com]”在使用参数()调用目标RNGoogleSignin上的登录时引发 我已经提到了链接 请帮忙。提前感谢。关于 和提比略海的答案 “对我来说,我在JS文件中使用了#id.apps.usercontent.com而不是#id.apps.googleusercontent.com 验证您在INFO.plist和js

我试图在我的react原生应用程序中集成GoogleSignin

但我得到了一个例外:

“您的应用缺少对以下URL方案的支持[#id.apps.googleusercontent.com]”在使用参数()调用目标RNGoogleSignin上的登录时引发

我已经提到了链接

请帮忙。提前感谢。

关于

提比略海的答案

“对我来说,我在JS文件中使用了#id.apps.usercontent.com而不是#id.apps.googleusercontent.com

验证您在INFO.plist和js文件中定义的URL方案是否相同,如下所示:

然后在INFO.plist中,URL应为:

'com.googleusercontent.apps.#id' 及 “#id.apps.googleusercontent.com” 这解决了我的问题。”

我的答案

我需要将这两个url方案添加到Info plist文件中,如下所示:

'com.googleusercontent.apps.#id'

“#id.apps.googleusercontent.com”

以及包标识符

这是因为我在JS文件中添加了ClientId,如链接中所示:

GoogleSignin.configure({ 
iosClientId: <FROM DEVELOPER CONSOLE>, // only for iOS 
}).then(() => {
// you can now call currentUserAsync()
});
GoogleSignin.configure({
iosClientId:,//仅适用于iOS
}).然后(()=>{
//现在可以调用currentUserAsync()
});
但它只要求添加反向的客户端ID

在“信息”面板中配置URL类型

添加一个URL,将scheme设置为您的反向客户端ID(可在plist中找到)

GoogleSignin.configure({ 
iosClientId: <FROM DEVELOPER CONSOLE>, // only for iOS 
}).then(() => {
// you can now call currentUserAsync()
});