swift - Getting 403 forbidden error while retrieving locations from quickblox -
i getting status 403 forbidden when use retrieve locations,if sending location sent. here code implementing
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 qbuuser }, errorblock: { (response: qbresponse!) in println(response.error) }) // additional setup after loading view. } @ibaction func getlocationtapped(sender: anyobject) { qbrequest.geodatawithid(self.userdetails!.id, successblock: { (response: qbresponse!,geodata: qblgeodata!) in println("geodata: \(geodata)") }, errorblock: nil) }
and error log.
quickbloxchat[2332:33100] request headers: { "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] response headers: { "access-control-allow-origin" = "*"; "cache-control" = "no-cache"; connection = "keep-alive"; "content-length" = 24; "content-type" = "application/json; charset=utf-8"; date = "sat, 03 oct 2015 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" = miss; "x-request-id" = 9ef416cd199c9c8749dd85ce4a8d146b; "x-runtime" = "0.016744"; "x-ua-compatible" = "ie=edge,chrome=1"; }
i tried out login before getgeodatawithid method doesn't work.
please me out of it.
in advance.
the issue here pass user's id instead of id of geodata object
qbrequest.geodatawithid(self.userdetails!.id
Comments
Post a Comment