我的问题似乎与这个问题几乎相同,但从未解决过:
https://www.parse.com/questions/installation-not-created
当我从 Parse 数据浏览器中删除所有安装时它开始了(坏主意,我现在知道了)。现在的问题是它不会从我的一个(真实的)测试设备中保存任何新安装,大概是因为这个令人困惑的错误:
Error: badge must be a non-negative integer: -3 (Code: 111, Version: 1.2.20)
当我尚未对角标(Badge)编号执行任何操作时,这发生在全新安装时。更复杂的是,Parse 将保存来自其他(真实)设备和模拟器的安装。作为引用,这就是我尝试在我的 AppDelegate.m 中保存安装的方式:
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
// Store the deviceToken in the current installation and save it to Parse.
PFInstallation *currentInstallation = [PFInstallation currentInstallation];
[currentInstallation setDeviceTokenFromData:deviceToken];
[currentInstallation saveInBackground];
}
有什么想法吗?
最佳答案
我仍然不知道为什么会出现这个错误,但解决方案似乎是插入以下代码行,然后在安装后将其删除:
[[PFInstallation currentInstallation] setBadge:0];
关于ios - 解析不会保存安装,错误 : badge must be a non-negative integer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25494311/