菜鸟教程小白 发表于 2022-12-12 15:50:16

ios - 没有可用应用程序时在浏览器中登录 Twitter


                                            <p><p>我正在构建一个样本来通过 twitter 进行身份验证,我把文档扔在这里:<a href="http://docs.fabric.io/ios/twitter/authentication.html" rel="noreferrer noopener nofollow">http://docs.fabric.io/ios/twitter/authentication.html</a> </p>

<p>实现登录按钮后,它只访问手机中的帐户,如果没有帐户,它只是不去浏览器并登录。作为 Facebook 或 Google+。 </p>

<p>这就是我在 <code>viewDidLoad</code> 中的内容:</p>

<pre><code>TWTRLogInButton* logInButton = [TWTRLogInButton buttonWithLogInCompletion:^(TWTRSession* session, NSError* error) {
    if (session) {
      self.userName.text = ];
      self.UserID.text = ];
    } else {
      NSLog(@&#34;error: %@&#34;, );
    }
}];
logInButton.center = CGPointMake(190.0, 250.0);
;


[ logInWithCompletion:^(TWTRSession *session, NSError *error) {
    if (session) {
      self.userName.text = ];
      self.UserID.text = ];
    } else {
      NSLog(@&#34;error: %@&#34;, );
    }
}];
</code></pre>

<p>在 <code>AppDelegate</code> 中:</p>

<pre><code>[ startWithConsumerKey:@&#34;something&#34; consumerSecret:@&#34;another thing&#34;];
]];
</code></pre>

<p>如何允许使用浏览器登录?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>我在 Twitter 应用程序管理中的设置选项卡下添加了一个 <code>回调 URL</code>,然后它可以在不删除任何内容的情况下运行。</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 没有可用应用程序时在浏览器中登录 Twitter,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/31400820/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/31400820/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 没有可用应用程序时在浏览器中登录 Twitter