I came across the strange PFInstallation behavior of my iOS application. Each time I launch the application, I register the device to receive push notifications and call the code below the didRegisterForRemoteNotificationsWithDeviceToken method:
PFInstallation *currentInstallation = [PFInstallation currentInstallation]; [currentInstallation setDeviceTokenFromData:deviceToken]; NSLog(@"%@", currentInstallation ); [currentInstallation saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) { if (succeeded) { NSLog(@"currentInstallation saved" ); } if (error) { NSLog(@"currentInstallation NOT saved" ); } }];
When I install the application on my iphone, the installation will be saved correctly using deviceToken. I am absolutely sure that a few days ago I manually deleted deviceToken via the Parse control panel (to try something), and then restarted restarting the device again. The same goes for some channels that I used. Today, the Token device is not saved, nor channels. SaveInBackgroundWithBlock completed successfully, but the deviceToken field is empty. The NSLog of the current installation contains deviceToken, but it is not saved. Trying to understand the reason for this behavior, I found that if I add the line currentInstallation.deviceToken = @""; immediately after PFInstallation *currentInstallation = [PFInstallation currentInstallation]; , then the Token device will be saved correctly. Use the Pars guru, explain to me why this happens, and why a few days ago it is not? I recently updated the Parse Framework in this application, maybe this is the reason?
Diego source share