未配置 Meteor 登录服务

tha*_*guy 5 javascript cordova meteor

我正在使用 Meteor.loginWithFacebook 让用户访问我的应用程序。代码是

Meteor.loginWithFacebook({
    loginStyle:"redirect"
}, function(err){
    if (err) {
        throw err;
    }
    else{
        window.location = "/landing"
    }
});
Run Code Online (Sandbox Code Playgroud)

我的服务器有一个带有以下内容的 accounts.js:

ServiceConfiguration.configurations.remove({
  service: "facebook"
});
ServiceConfiguration.configurations.insert({
  service: "facebook",
  appId: "id",
  secret: "secret"
});
Run Code Online (Sandbox Code Playgroud)

它可以在桌面上运行,并且在捆绑到cordova 中时也可以运行,但突然之间,它无法运行并显示登录服务尚未配置的错误。

未捕获的错误:ServiceConfiguration.ConfigError:尚未加载登录服务配置:2199:http://meteor.local/packages/blaze.js

我一直看到Accounts.loginServicesConfigured()到处都提到,但没有看到文档中的解释,因此不知道如何使用它。

有什么帮助吗?

tha*_*guy 3

解决方案在 IronRouter 中:

waitOn:function(){
    Accounts.loginServicesConfigured();
}
Run Code Online (Sandbox Code Playgroud)