You need to enable JavaScript to run this app. iOS 14.2系统下Google登录gapi.auth2相关方法返回空值问题咨询
优惠活动
大模型
产品
解决方案
定价
更多

iOS 14.2系统下Google登录gapi.auth2相关方法返回空值问题咨询

登录页搭建环节身份验证初始化代码
this.auth2 = window.gapi.auth2
.init({
client_id: process.env.GOOGLE_ID,
ux_mode: 'redirect',
redirect_uri: process.env.GOOGLE_LOGIN_REDIRECT, // https://domain/callback
scope: 'profile email',
prompt: 'select_account',
})
.then(() => {
let googleAuth = window.gapi.auth2.getAuthInstance();
googleAuth.signIn()
});
异常表现
  • gapi.auth2初始化完成后,调用window.gapi.auth2.getAuthInstance()获取身份实例时返回空;
  • 跳转至回调页面后,执行window.gapi.auth2.getAuthInstance().currentUser.get().getAuthResponse()获取身份响应结果也返回空。

上述异常仅在iOS 14.2系统下复现,其他iOS版本及安卓平台均运行正常。


内容的提问来源于stack exchange,提问作者user3050742

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.11.13 03:06:03