Ren*_*las 7 react-native google-signin expo
我的 Google 登录有问题,我目前正在使用 EXPO 应用程序,我希望不惜一切代价不要弹出/选择退出 Expo,问题是当我单击按钮在我的应用程序中使用 Google 登录时,它确实会带我进入浏览器内的登录页面,但一旦我输入我的 Google 凭据,它就会进入 Google.com 页面。
我检查了很多帖子,但仍然无法让它返回到应用程序。
我的应用程序登录代码是:
//import de Google en Expo
import * as Google from 'expo-google-app-auth';
import * as AppAuth from 'expo-app-auth';
export const googleLogin = () => {
console.log('***Entro en Google***');
return async dispatch => {
try {
const result = await Google.logInAsync({
androidClientId: '***my ID Censored***',
scopes: ['profile', 'email'],
behavior: 'web',
redirectUrl: `${AppAuth.OAuthRedirect}:/oauthredirect`
});
console.log('***Hizo Consulta***');
if (result.type === 'success') {
console.log(result.accessToken);
} else {
return { cancelled: true };
}
} catch (e) {
return { error: true };
}
}
};
Run Code Online (Sandbox Code Playgroud)
我查了很多帖子,发现问题出在重定向 URL 上,我尝试设置 4 个选项:
${AppAuth.OAuthRedirect}:/oauthredirect${AppAuth.OAuthRedirect}:/oauthredirect/google它们都不起作用,我做了 host.exp.exponent 的最后 2 个,因为这是 Expo 在其文档中使用的捆绑标识符:
https://docs.expo.io/versions/latest/sdk/google/
创建 Android OAuth 客户端 ID
我就是这么做的,现在它总是卡在 google.com 页面上,有什么想法或建议吗?
亲切的问候
| 归档时间: |
|
| 查看次数: |
3010 次 |
| 最近记录: |