I have a strange problem. Some of my users return empty (or zero) device tokens for Apple Push Notification . This happens only to some users, but not to all users,
Here is 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 the device is Jail break , why do I get the token of the nil device?
Refresh
For example, the first user to enable push notification and work correctly,
Now the user will go to the settings and disable the notification from the settings

Then after that I wonβt get the device token , it was fine, but the problem now turned off the application,
Then after downloading the application again, after didRegisterForRemoteNotificationsWithDeviceToken not called, so I get a device token zero, and when I check the setting, it will show a notification
Mayank patel
source share