iPhone Newsstand push registration Failure

2019-05-06 20:38发布

问题:

// Register for notifications

[[UIApplication sharedApplication]
 registerForRemoteNotificationTypes:(
                                     UIRemoteNotificationTypeAlert |
                                     UIRemoteNotificationTypeBadge |
                                     UIRemoteNotificationTypeSound |
                                     UIRemoteNotificationTypeNewsstandContentAvailability)];

This is the code I use for registering for registering for push notifications. The app registers for Alert, Badges, Sound. But the app did not register for the newsstand push notifications. Checked it in

didRegisterForRemoteNotificationsWithDeviceToken

method, with this condition

if([application enabledRemoteNotificationTypes] & UIRemoteNotificationTypeNewsstandContentAvailability)

What might the issue with this code.

回答1:

Did you already include the Newsstand Info.plist keys? You can check if the app registered for Newsstand pushes in Settings/Store.



回答2:

Push notifications don't work on iPhone Simulator, so try to run it on a device.

If this doesn't help, try to:

  • implement application:didFailToRegisterForRemoteNotificationsWithError: method on delegate and check error description
  • check push settings for this app ID and regenerate provisioning profile
  • check aps-environment