当我用来检索位置时,我的状态为403禁止,如果我发送的位置已成功发送。这是我正在实施的代码
override func viewDidLoad() {
super.viewDidLoad()
QBChat.instance().delegate = self
user.login = uname
user.password = pass
QBRequest.logInWithUserLogin(uname, password: pass, successBlock: nil, errorBlock: nil)
QBRequest.userWithLogin(uname, successBlock: { (response: QBResponse!,user: QBUUser!) in
self.userDetails = user as QBUUser
}, errorBlock: { (response: QBResponse!) in
println(response.error)
})
// Do any additional setup after loading the view.
}
@IBAction func getLocationTapped(sender: AnyObject) {
QBRequest.geoDataWithId(self.userDetails!.ID, successBlock: { (response: QBResponse!,geoData: QBLGeoData!) in
println("GeoData: \(geoData)")
}, errorBlock: nil)
}
这是我的错误日志。
QuickBloxChat [2332:33100]请求标头:{ “Content-Type”=“application / json”; “QB-SDK”=“iOS 2.1”; “QB-Token”= 14f4ec467c5d9f00eb938529962366938042b05a; “QuickBlox-REST-API-Version”=“0.1.1”; 2015-10-03 11:56:26.143 QuickBloxChat [2332:33100]响应头:{ “Access-Control-Allow-Origin”=“*”; “Cache-Control”=“no-cache”; Connection =“keep-alive”; “内容长度”= 24; “Content-Type”=“application / json; charset = utf-8”; 日期=“星期六,2015年10月3日06:26:25 GMT”; “QB-Token-ExpirationDate”=“2015-10-03 08:26:14 UTC”; “QuickBlox-REST-API-Version”=“0.1.1”; Server =“nginx / 1.6.2”; Status =“403 Forbidden”; “X-Rack-Cache”=小姐; “X-Request-Id”= 9ef416cd199c9c8749dd85ce4a8d146b; “X-Runtime”=“0.016744”; “X-UA-Compatible”=“IE = Edge,chrome = 1”; }
我在getGeoDataWithID方法之前尝试登录,但它不起作用
请帮我摆脱它。
提前谢谢。
答案 0 :(得分:0)
这里的问题是您传递用户的ID而不是某个地理数据对象ID
QBRequest.geoDataWithId(self.userDetails!.ID