swift2 - My app cannot generate device token -


suddenly app cannot generate device token. created app receive remote push notification, thje app worked well, today app dont generate device token, run code on xcode , dont generate token. no delegates method called. dont change , dont work more. function didregisterforremotenotificationswithdevicetoken dont work. look:

func application(application: uiapplication, didregisterforremotenotificationswithdevicetoken devicetoken: nsdata) {     print(devicetoken) } 

dont print nothing

this function nothing:

func application(application: uiapplication, didfailtoregisterforremotenotificationswitherror error: nserror) {     print(error) } func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject: anyobject]?) -> bool {     // override point customization after application launch.      let types:uiusernotificationtype = [uiusernotificationtype.alert, uiusernotificationtype.badge, uiusernotificationtype.sound]       application.registerusernotificationsettings(uiusernotificationsettings(fortypes: types, categories: [newscategory]))      return true } 

why problem? how can fix it?

you have call application.registerforremotenotifications() in application:didfinishlaunchingwithoptions after registering settings.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -