2013-02-20 96 views
1

我有一個字符串的數組,我試圖保存解析爲推送通知的渠道。該數組是正確的,把我不知道發生了什麼。任何人都可以對此有所瞭解嗎?謝謝。iOS parse.com推送錯誤

錯誤:

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

回答

1

的原因是解析不接受的渠道空格或特殊字符。刪除所有空格和特殊字符後,操作成功。