stackmob ios数据存储http 401错误
我正在使用iOS数据存储API将数据上传到StackMob。当我尝试使用用公钥初始化的smclient时,出现此错误stackmob ios数据存储http 401错误,ios,datastore,http-status-code-401,stackmob,Ios,Datastore,Http Status Code 401,Stackmob,我正在使用iOS数据存储API将数据上传到StackMob。当我尝试使用用公钥初始化的smclient时,出现此错误 HTTP Code=401 "The operation couldn’t be completed. (HTTP error 401.)" UserInfo=0xa14dac0 {error=Insufficient authorization} 示例代码 [[self.smclient dataStore] createObject:eventDictObj
HTTP Code=401 "The operation couldn’t be completed. (HTTP error 401.)" UserInfo=0xa14dac0 {error=Insufficient authorization}
示例代码
[[self.smclient dataStore] createObject:eventDictObj
inSchema:@"EventSchema"
onSuccess:^(NSDictionary *object, NSString *schema)
{
NSLog(@"Created online event : %@", object);
successBlock();
}
onFailure:^(NSError *error, NSDictionary* object, NSString *schema)
{
failedBlock(error);
}];
smclient的初始化如下所示
self.smclient = [[SMClient alloc] initWithAPIVersion:@"0" publicKey:@"xxxxxxxxxx"];
对于此用例,我不需要使用已登录的用户凭据在StackMob中创建此条目确保已将权限设置为在stack mob数据库上打开