I have a strange issue, Some of my users are returning blank (or null) device tokens for Apple Push Notification. It happening only some of user's only not for all user's,
Here's my code,
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
#if !TARGET_IPHONE_SIMULATOR
[_globalKRData setPreferences:deviceToken withKey:kPushToken]; // Preferences
PFInstallation *currentInstallation = [PFInstallation currentInstallation];
[currentInstallation setDeviceTokenFromData:deviceToken];
currentInstallation.channels = @[@"global"];
[currentInstallation saveInBackground];
#endif
}
Is it possible if device is Jail break that's why i getting nil device token ?
Update
For example First time user allowing push notification and it works properly,
Now user go to setting and disable the notification from setting's
Then after it i will not get device token that was fine but problem is now user uninstall the app,
Then after Download the app again then after didRegisterForRemoteNotificationsWithDeviceToken not called so i getting nil device token and when i check setting it will showing notification on
