简体   繁体   English

解析返回未经授权的错误

[英]Parse Returns Unauthorized Error

I downloaded the Parse starter project for Swift, filled out the Parse.setApplicationId() method so it contained the App Id and the Master Key to the app I deployed through heroku, and when I ran it, I got the following errors: 我下载了Swift的Parse入门项目,填写了Parse.setApplicationId()方法,因此其中包含我通过heroku部署的应用程序的应用程序ID和主密钥,并且在运行它时,出现以下错误:

2016-06-01 18:19:02.063 ParseStarterProject[66355:25475020] [Error]: unauthorized (Code: 100, Version: 1.7.5) 2016-06-01 18:19:02.063 ParseStarterProject [66355:25475020] [错误]:未经授权(代码:100,版本:1.7.5)
2016-06-01 18:19:02.064 ParseStarterProject[66355:25475023] [Error]: Failed to run command eventually with error: Error Domain=Parse Code=100 "unauthorized" UserInfo={code=100, originalError=Error Domain=NSURLErrorDomain Code=-1011 "(null)", temporary=0, error=unauthorized, NSLocalizedDescription=unauthorized} 2016-06-01 18:19:02.064 ParseStarterProject [66355:25475023] [错误]:最终无法运行命令,并出现以下错误:错误域=解析代码= 100“未经授权” UserInfo = {code = 100,originalError = Error Domain = NSURLErrorDomain代码= -1011“(null)”,临时= 0,错误=未经授权,NSLocalizedDescription =未经授权}

You should use this code : 您应该使用以下代码:

let configuration = ParseClientConfiguration {
    $0.applicationId = kParseApplicationID
    $0.clientKey = kParseClientKey
    $0.server = kParseServerURL
    $0.localDatastoreEnabled = true
}
Parse.initializeWithConfiguration(configuration)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM