流星应用-Facebook登录-弹出窗口无法关闭 [英] Meteor app - facebook login - popup doesn't close

查看:92
本文介绍了流星应用-Facebook登录-弹出窗口无法关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Facebook流星应用登录似乎正常工作,除了登录弹出窗口永不关闭.弹出窗口保持打开状态,直到重新加载应用程序为止.我什至没有从哪里开始调试这个... 弹出窗口为空白,检查显示:

My meteor app login with facebook seems to work properly except that the login popup never closes. The popup window stays open until the app is reloaded. I don't even where to start to debug this... The popup is blank and the inspect reveals :

<p id="completedText" style="display:none;">
    Login completed. <a href="#" onclick="window.close()">
      Click here</a> to close this window.
  </p>

style = display:none可能是为什么弹出窗口显示为空白但我不知道如何更新该样式的原因.另外,如果我从控制台执行window.close(),则弹出窗口消失,但应用程序未注册登录.

The style=display:none is probably why the popup appears blank but I don't know how to update that style. Also, if I perform a window.close() from the console, the popup disappears but the app doesn't register the login.

顺便说一句,此错误仅在我通过域名使用我的应用程序时出现,当我从IP地址调用它时,它仍然可以正常工作.

BTW, this bug only appears when I use my app from my domain name, when I call it from the IP address, it works just fine.

推荐答案

显然,这是iOS的已知错误,可以通过更改loginStyle参数来解决:

Apparently this is a known bug with iOS and can be solved by changing the loginStyle parameters:

通常,基于弹出窗口的流程更可取,因为用户不必在登录流程结束时重新加载整个应用程序.但是,基于弹出窗口的流需要并非在所有移动环境中都可用的浏览器功能,例如window.close和window.opener.特别是,我们建议在以下环境中使用Meteor.loginWith({loginStyle:"redirect"}):

Usually, the popup-based flow is preferable because the user will not have to reload your whole app at the end of the login flow. However, the popup-based flow requires browser features such as window.close and window.opener that are not available in all mobile environments. In particular, we recommend using Meteor.loginWith({ loginStyle: "redirect" }) in the following environments:

内部UIWebViews(将您的应用程序加载到移动应用程序中时) 在iOS8的Safari中(由于存在错误,不支持window.close)

Inside UIWebViews (when your app is loaded inside a mobile app) In Safari on iOS8 (window.close is not supported due to a bug)

流星文档

这篇关于流星应用-Facebook登录-弹出窗口无法关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆