我正在尝试使用QuickBlox框架开始一个新项目。
我在管理面板上创建了一个帐户和一个应用程序,并获得了我的宝贵钥匙。然后我下载了iOS-location-sample代码,并在 AppDelegate.m 中用我的值替换了这些代码:
[QBApplication sharedApplication].applicationId = MY_APP_ID;
[QBConnection registerServiceKey:MY_KEY];
[QBConnection registerServiceSecret:MY_SECRET];
[QBSettings setAccountKey:MY_ACCOUNT_ID];
顺便说一句,我还需要添加 SLLMapViewController.m 这些行,以便在iOS 8+上进行本地化工作:
- (void)viewDidLoad
{
[super viewDidLoad];
self.locationManager = [CLLocationManager new];
[self.locationManager requestWhenInUseAuthorization]; // Added
[self.locationManager requestAlwaysAuthorization]; // Added
[self.locationManager startUpdatingLocation];
}
并在 SimpleSample-location_users-ios-Prefix.pch
<key>NSLocationWhenInUseUsageDescription</key>
<string>Allow localization for this app ?</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Allow localization when in background ?</string>
我的问题是,当我在不更改帐户/应用程序密钥的情况下启动示例应用程序时,它可以工作。但是在用我自己的值替换它们之后,启动屏幕会继续加载,我在控制台中得到它(在其他一些行之后):
2015-04-14 16:37:24.429 Location[2057:992725] Request headers: {
"Content-Type" = "application/json";
"QB-SDK" = "iOS 2.2.3";
"QB-Token" = 1db6140b1a921ad88ee24f900b814535a81d5aaa;
"QuickBlox-REST-API-Version" = "0.1.1";
}
2015-04-14 16:37:24.692 Location[2057:992708] Error =
Error reasons:(null)
2015-04-14 16:37:24.691 Location[2057:992725] Response headers: {
"Access-Control-Allow-Origin" = "*";
"Cache-Control" = "no-cache";
Connection = "keep-alive";
"Content-Type" = "application/json; charset=utf-8";
Date = "Tue, 14 Apr 2015 14:37:24 GMT";
"QB-Token-ExpirationDate" = "2015-04-14 16:37:24 UTC";
"QuickBlox-REST-API-Version" = "0.1.1";
Server = "nginx/1.0.15";
Status = "404 Not Found";
"Transfer-Encoding" = Identity;
"X-Rack-Cache" = miss;
"X-Request-Id" = 13dd7171da034601955925a38f076c21;
"X-Runtime" = "0.012323";
"X-UA-Compatible" = "IE=Edge,chrome=1";
}
有没有人知道发生了什么?我注意到 Status =“404 Not Found”但不知道该怎么做......