简体   繁体   English

Google客户端授权不适用于移动IOS IPhone(41.0.2272.58)

[英]Google Client Authorize doesn't work on Mobile IOS IPhone(41.0.2272.58)

We use gapi.js for Google authorising. 我们使用gapi.js进行Google授权。 It works correct on majority of desktop browsers and on mobile Safari. 它在大多数台式机浏览器和移动Safari上均可正常运行。 But it doesn't on Mobile Chrome IOS(41.0.2272.58). 但它不在Mobile Chrome IOS(41.0.2272.58)上。

In the begging we load gapi.js script 在乞求中,我们加载gapi.js脚本

require(['https://apis.google.com/js/client.js?onload=gapiIsLoaded'];

Then we try authorize using: 然后,我们尝试使用以下方法授权:

gapi.auth.authorize(params, handler);

Params are 参数是

var params = {
                client_id: MY_CLIENT_ID,
                scope: MY_SCOPES,
                immediate: false // to open popup
            };

Browsers shows popup and I can autorize and continue work. 浏览器显示弹出窗口,我可以自动完成并继续工作。 IOS Safari works correct too. iOS Safari也可以正常工作。

But Chrome IOS never calls handler callback. 但是Chrome IOS从未调用handler回调。

This issue extends to Chrome for Android 5.0. 此问题扩展到Android 5.0版的Chrome。 In my case, downgrading to 39.0.2171.59 resolves the problem. 就我而言,降级到39.0.2171.59解决了这个问题。 Hopefully this information puts you closer to finding the root cause. 希望这些信息可以使您更接近根本原因。

通过添加重定向ur而不是打开窗口来解决问题, 网址为https://github.com/google/google-api-javascript-client/issues/189

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM