我有一个字符串数组,我试图将其保存以解析为推送通知的 channel 。数组是正确的,我不知道发生了什么。有人可以对此有所了解吗?谢谢。
错误:
Error: Bad channel name: TestString123 (Code: 112, Version: 1.1.30)
代码:
- (void)saveSelectedDepartmentsToParse:(NSMutableDictionary *)dictionary {
NSArray *array = [dictionary allKeysForObject:@"YES"];
NSLog(@"Array = %@", array);
PFInstallation *currentInstallation = [PFInstallation currentInstallation];
[currentInstallation addObjectsFromArray:array forKey:@"channels"];
[currentInstallation saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
if (error == nil) {
NSLog(@"Parse Save Succeeded");
}
else {
NSLog(@"Parse Save Failed, %@", error.localizedDescription);
}
}];
}
最佳答案
原因是因为 Parse 不接受 channel 中的空格或任何特殊字符。去除所有空格和特殊字符后,操作成功。
关于iOS parse.com 推送错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14971705/