- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将 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/
我是一名优秀的程序员,十分优秀!