gpt4 book ai didi

ios - React-Native:异常 'Your app is missing support for the following URL schemes[#id.apps.googleusercontent.com]'

转载 作者:行者123 更新时间:2023-12-04 17:46:39 24 4
gpt4 key购买 nike

我正在尝试将 GoogleSignin 集成到我的 react-native 应用中。

但是我得到了一个异常(exception):

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

我提到了 react-native-google-signin链接

请帮忙。提前致谢。

最佳答案

参照 react-native-google-signin iOS login issue

tiberiumihai的回答

'For me I used in JS file #id.apps.usercontent.com instead of #id.apps.googleusercontent.com.

Verify that you have the same URL schemes defined in your INFO.plist and in your js file like this:

await GoogleSignin.configure({
iosClientId: '#id.apps.googleusercontent.com',
webClientId: '#id.apps.googleusercontent.com',
offlineAccess: false
});

Then in your INFO.plist, the URL should be:

'com.googleusercontent.apps.#id' and '#id.apps.googleusercontent.com' This solved my problem.'

我的答案

我需要将两个 url-schemes 添加到 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()
});

但它只要求添加 REVERSED_CLIENT_ID

Configure URL types in the Info panel

add a URL with scheme set to your REVERSED_CLIENT_ID (found inside the plist)

关于ios - React-Native:异常 'Your app is missing support for the following URL schemes[#id.apps.googleusercontent.com]',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48200290/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com