I notice some devices doesn't generate device token for push notification. I have been using the following code to generate device token and implemented the
didRegisterForRemoteNotificationsWithDeviceToken
method
var types: UIUserNotificationType = UIUserNotificationType.Badge |
UIUserNotificationType.Alert |
UIUserNotificationType.Sound
var settings: UIUserNotificationSettings = UIUserNotificationSettings( forTypes: types, categories: nil )
application.registerUserNotificationSettings( settings )
application.registerForRemoteNotifications()
I get device token for some devices.However i thought device token was not generated for some devices due to lack of internet connnection.To be sure, i turned off the internet connection and made sure that was my problem but it successfully generates token?
In my knowledge my app requests the device token with the apple server...
Why is this happening.And how is device token generated?
Do i really dont need internet connection to generate device token