菜鸟教程小白 发表于 2022-12-11 17:52:24

ios - Meteor Social Login - 使用 Facebook 或 Google 登录 oauth2 时出现空白页面


                                            <p><p>我正在使用 Meteor 和 Facebook 或 Google 登录开发移动应用程序。</p>

<p>在 Android 设备上效果很好。</p>

<p>但在 iOS 设备上,成功验证后我得到一个空白页面。用户必须单击“完成”按钮才能关闭页面并让应用重新获得控制权。</p>

<p> <a href="/image/pOzEE.png" rel="noreferrer noopener nofollow"><img src="/image/pOzEE.png" alt="Screenshot of &#34;Done&#34; button to be clicked on"/></a> </p>

<p>Meteor 版本 <code>1.3.4.4</code> 和最新的 <code>accounts-facebook</code>、<code>accounts-google</code> 包。</p>

<p>这是我用于登录的代码:</p>

<pre class="lang-js prettyprint-override"><code>//Oauth login with Facebook.
this.loginFB = function() {
Meteor.loginWithFacebook({
   requestPermissions: [&#39;email&#39;, &#39;public_profile&#39;],
   redirectUrl: Meteor.absoluteUrl(&#39;_oauth/facebook&#39;)
}, function(err){
    if( err.error === &#39;Email exists.&#39; ) {
      if (Meteor.isCordova) {

      } else {

      }
    }
});
};

//Oauth login with Google.
this.loginGoogle = function() {
Meteor.loginWithGoogle({
    requestPermissions: [&#39;email&#39;, &#39;profile&#39;],
    redirectUrl: Meteor.absoluteUrl(&#39;_oauth/google&#39;)
}, function(err){
    if( err.error === &#39;Email exists.&#39; ) {
      if (Meteor.isCordova) {

      } else {

      }
    }
});
};
</code></pre></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>我找到这个错误的解决方案很长时间了,但我找到了这个工作人员....
meteor 添加cordova:cordova-plugin-inappbrowser@ <a href="https://github.com/ephemer/cordova-plugin-inappbrowser.git#04091fde737519c149e7ad6316971cb6b490c5b3" rel="noreferrer noopener nofollow">https://github.com/ephemer/cordova-plugin-inappbrowser.git#04091fde737519c149e7ad6316971cb6b490c5b3</a>它对我有帮助,我认为它对你有帮助 =)</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - Meteor Social Login - 使用 Facebook 或 Google 登录 oauth2 时出现空白页面,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/40105055/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/40105055/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - Meteor Social Login - 使用 Facebook 或 Google 登录 oauth2 时出现空白页面