上传Installation数据失败。之前是好的,最近突然发现不行了。

总是返回错误:
上传DeviceToken失败, Invalid deviceProfile value. They must start with a letter, and a-zA-Z0-9_ are the only valid characters.

代码段:
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
AVInstallation *currentInstallation = [AVInstallation currentInstallation];
[currentInstallation setDeviceTokenFromData:deviceToken];
[currentInstallation saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
if (succeeded) {
NSLog(@"上传DeviceToken成功");
}
else{
NSLog(@"上传DeviceToken失败, %@", [error localizedDescription]);
}

}];

}

你有设置 deviceProfile? 这个错误是说 deviceProfile 设置错误。

没设置,但是一直报这个错误

是不是过去设置过,因为 AVInstallation 是有缓存的。你可以卸载再试下。

重新安装过了,还是不行~

这几乎不可能,你是卸载后再安装?

搜索你的代码吧,有没有 setDeviceProfile,没有设置怎么可能提交。