菜鸟教程小白 发表于 2022-12-11 19:28:31

iOS Google 登录不允许用户代理


                                            <p><p>我已经在 Objective-C iOS 应用程序中集成了谷歌登录,它工作正常,但现在它给出了这个错误一段时间。
<a href="/image/AopkL.png" rel="noreferrer noopener nofollow"><img src="/image/AopkL.png" alt="enter image description here"/></a> </p>

<p>这是点击按钮时的登录代码:</p>

<pre><code>.uiDelegate = self;
.delegate = self;
[ setScopes:@[@&#34;https://www.googleapis.com/auth/contacts.readonly&#34;,@&#34;https://www.google.com/m8/feeds/&#34;]];
[ signIn];
</code></pre></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>转成Objective-C后试试这个</p>

<pre><code> GIDSignIn.sharedInstance().delegate = self

GIDSignIn.sharedInstance().uiDelegate = self

GIDSignIn.sharedInstance().scopes.append(&#34;https://www.googleapis.com/auth/plus.stream.read&#34;)

GIDSignIn.sharedInstance().scopes.append(&#34;https://www.googleapis.com/auth/plus.me&#34;)

GIDSignIn.sharedInstance().hasAuthInKeychain()
</code></pre>

<p>也尝试在每次登录前退出</p>

<pre><code> [ signOut];

[ signIn];
</code></pre></p>
                                   
                                                <p style="font-size: 20px;">关于iOS Google 登录不允许用户代理,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/47875273/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/47875273/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: iOS Google 登录不允许用户代理