ios – 使用Facebook登录解析服务器时出错

我是使用 https://parse.com/docs/server/guide作为向导从Parse迁移到Heroku(带MongoLab沙箱)的众多用户之一.

迁移的事情进展顺利(可以通过远程仓库上的REST命令创建/检索对象),直到我尝试使用(iOS)Facebook登录.

方法

[PFFacebookUtils logInInBackgroundWithReadPermissions: ... ]

当Parse托管时,它一直在工作,现在返回以下错误

[Error]: Facebook auth is invalid for this user. (Code: 101,Version: 1.12.0)

注意:对我(之前工作的)iOS代码的唯一更改是将Parse服务器指向我新的手动托管的repo,如下所示:

let parseConfiguration = ParseClientConfiguration(block: { (ParseMutableClientConfiguration) -> Void in
        ParseMutableClientConfiguration.applicationId = "<*APP ID*>"
        ParseMutableClientConfiguration.clientKey = "<*CLIENT KEY*>"
        ParseMutableClientConfiguration.server = "https://<*HEROKU APP ID*>.herokuapp.com/parse"
    })

 Parse.initializeWithConfiguration(parseConfiguration)

&安培;对开源解析服务器代码(https://github.com/ParsePlatform/parse-server-example)的唯一修改是替换配置以匹配我的Parse / mongo标识:

var api = new ParseServer({
  databaseURI:     'mongodb://<*UNIUQUE ID*>' || 'mongodb://localhost:27017/dev',cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',appId: '<*PARSE APP ID*>',masterKey: '<*PARSE MASTER KEY*>'
});

解决方法

你需要添加密钥facebookAppIds,其中包含一系列有效的facebook app id,这在文档中提到了 here.

或者,添加FACEBOOK_APP_ID密钥作为引用[here](https://github.com/ParsePlatform/parse-server/issues/82)

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...