简体   繁体   English

iOS parse.com推送错误

[英]iOS parse.com push error

I have an array of string's that I am trying to save to parse as the channels for push notifications. 我有一个字符串数组,我试图保存以解析为推送通知的通道。 The array is correct, put I have no idea what is going on. 数组是正确的,我不知道发生了什么。 Can anybody throw some light on this? 有人可以对此有所启发吗? Thanks. 谢谢。

Error: 错误:

Error: Bad channel name: TestString123 (Code: 112, Version: 1.1.30) 错误:错误的频道名称:TestString123(代码:112,版本:1.1.30)

Code: 码:

- (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);
        }
    }];
}

The reason is because Parse does not accept whitespaces or any special characters in the channels. 原因是因为Parse在通道中不接受空格或任何特殊字符。 After removing all white spaces and special characters, the operation succeeded. 删除所有空格和特殊字符后,操作成功。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM