ios - SOLVED: Testing if push notification is turned on -


itemprop = "text">

Note: This was apparently due to some type of corruption in settings, the code appeared It was exactly the same with all ...

After the conversation in this thread: I said this boilerplate code on my app:

  if ([[UIApplication sharedApplication] RespondsToSelector: @ selector (registerUserNotificationSettings :)) {[UIApplication sharedApplication] registerUserNotificationSettings: [UIUserNotificationSettings settingsForTypes: UIRemoteNotificationTypeBadge section: zero]]; } And {[UIApplication shared applicant] registerfororemote notification type: UIRemoteNotificationTypeAlert]; } If ([[inLaunchOptions allKeys] containsObject: UIApplicationLaunchOptionsRemoteNotificationKey]) [[appTracking registerPush: [inLaunchOptions objectForKey: UIApplicationLaunchOptionsRemoteNotificationKey]]; }  

I also said the application: didRegisterUserNotificationSettings handler, which says a line of code, [application registerForRemoteNotifications] . When the app starts, this code is .

Reading that thread, it is suggested that it is all that is necessary, and this will cause the application that: didRegisterForRemoteNotificationsWithDeviceToken is called. But it's definitely not in my app.

Did I miss a step, or just understand how to understand it?

Try this:

  if ([answers app [ Tilak: @selector (registerUserNotificationSettings :)) {UIUserNotificationType userNotificationTypes = (UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound); UIUserNotificationSettings * settings = [UIUserNotificationSettings settingsForTypes: userNotificationTypes categories: nil]; [Application register user notification settings: settings]; [Application registerfororemote notification]; } Other {{Application RegisterForremote Notification Type: (URImot Notification Type) UITerm Notification Type Alert | Type the URImote notification type]]; }  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -