我刚刚更新到Quickblox SDK 2.7版。文档声明您不再需要管理令牌,只需在AppDelegate中初始化框架,如下所示:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[QBSettings setApplicationID:19879];
[QBSettings setAuthKey:@"xxxxxx"];
[QBSettings setAuthSecret:@"xxxxxxx"];
[QBSettings setAccountKey:@"xxxxxx"];
return YES;
}
然后在应用程序中,我尝试通过执行以下操作注册新用户:
-(void)createNewUser:(NSString *)userName Password:(NSString *)password{
QBUUser *user = [QBUUser user];
user.password = password;
user.login = userName;
[QBRequest signUp:user successBlock:^(QBResponse *response, QBUUser *user) {
[self signInUser:userName Password:password];
} errorBlock:^(QBResponse *response) {
NSLog(@"Response error = %@", response.error.error.description);
}];
}
但每次我尝试注册用户时,我都会收到Quickblox的回复说:
[QBCore] Response error reasons: {
errors = (
"Token is required"
);
}
我如何获得令牌。文档有点令人困惑,它讨论了使用现有的Quickblox令牌开始会话,但没有描述如何创建或获取令牌。
我尝试添加:
QBASesssion *sesssion = [QBASession new];
[QBASession currentSession] startSessionWithDetails:session updateSessionBlock: {
}
但我认为该方法是使用现有的令牌。