保存Parse PFInstallation对象时丢失的字段

wal*_*ace 2 xcode ios parse-platform

我在应用程序中保存了一个PFInstallation对象:didFinishLaunchingWithOptions - 我没有要求用户提供推送权限或与deviceToken有关 - 我发现很多标准字段都没有填充,包括:

  • appIdentifier
  • appVersion
  • APPNAME
  • 徽章
  • parseVersion
  • 时区

(这些列在数据浏览器中未定义,并且不显示在PFInstallation对象的NSLog上.)

  • deviceType 确实已填充

我抓住并成功将deviceModel和deviceOS保存到两个自定义列.但我有点困惑的是为什么上面的列未被定义.

这是代码:

[Parse setApplicationId:PARSE_APPID_DEV
              clientKey:PARSE_CLIENTKEY_DEV];

// record device model and OS
NSString *model = [self getDeviceModelAndNumber]; // via sys/utsname.h
NSString *sysVersion = [[UIDevice currentDevice] systemVersion];

PFInstallation *currentInstallation = [PFInstallation currentInstallation];
PFUser *loggedUser = [PFUser currentUser];
if (loggedUser)
    [currentInstallation setObject:loggedUser forKey:@"user"];

[currentInstallation setObject:model forKey:@"deviceModel"];
[currentInstallation setObject:sysVersion forKey:@"deviceOS"];
NSLog(@"installation: %@", currentInstallation);
[currentInstallation saveInBackground];
Run Code Online (Sandbox Code Playgroud)

这个项目是在Xcode 6中创建的.在Xcode 5中创建的一个不同的项目中,我基本上做了同样的事情,并且正在填充和保存列.

其他人遇到这个吗?我已经谷歌搜索了相当多但没有找到解决方案.任何帮助非常感谢.

wal*_*ace 9

经过多次实验,似乎(显着地)将最后一行改为

[currentInstallation saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
    // some logging code here
}];
Run Code Online (Sandbox Code Playgroud)

解决了这个问题.所以我想我应该向Parse提交一个错误.(事实上​​,已经开放了一个:https://developers.facebook.com/bugs/712949858787516/)