OGeek|极客世界-中国程序员成长平台

标题: iOS Google 登录不允许用户代理 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 19:28
标题: iOS Google 登录不允许用户代理

我已经在 Objective-C iOS 应用程序中集成了谷歌登录,它工作正常,但现在它给出了这个错误一段时间。 enter image description here

这是点击按钮时的登录代码:

[GIDSignIn sharedInstance].uiDelegate = self;
[GIDSignIn sharedInstance].delegate = self;
[[GIDSignIn sharedInstance] setScopes[@"https://www.googleapis.com/auth/contacts.readonly",@"https://www.google.com/m8/feeds/"]];
[[GIDSignIn sharedInstance] signIn];



Best Answer-推荐答案


转成Objective-C后试试这个

 GIDSignIn.sharedInstance().delegate = self

 GIDSignIn.sharedInstance().uiDelegate = self

 GIDSignIn.sharedInstance().scopes.append("https://www.googleapis.com/auth/plus.stream.read")

 GIDSignIn.sharedInstance().scopes.append("https://www.googleapis.com/auth/plus.me")

 GIDSignIn.sharedInstance().hasAuthInKeychain()

也尝试在每次登录前退出

 [[GIDSignIn sharedInstance] signOut];

 [[GIDSignIn sharedInstance] signIn];

关于iOS Google 登录不允许用户代理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47875273/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4