Registering for UIRemoteNotificationTypeNewsstandContentAvailability overrides UIRemoteNotificationTypeBadge
| Originator: | chris.s.patterson | ||
| Number: | rdar://17728869 | Date Originated: | 7/18/2014 |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | 7.1 |
| Classification: | UI/Usability | Reproducible: | Always |
Summary: When an iOS application registers to receive remote notifications by calling UIApplication -registerForRemoteNotificationTypes:, and passes a value for the "types" parameter that includes both UIRemoteNotificationTypeNewsstandContentAvailability and UIRemoteNotificationTypeBadge, any remote notifications that contain a "badge" value in the aps payload are ignored. It should NOT be ignored. If an app is designed such that it can respond to multiple kinds of remote notifications, say one that includes a badge, sound, and alert for user data, and another one that merely includes the "content-available" flag and a custom payload to perform a background download of app data, it is currently impossible for it to do so. Steps to Reproduce: 1. Create a sample iOS app using any Xcode template. 2. In the -application:didFinishLaunchingWithOptions: delegate method, add code to register for remote notifications via UIApplication -registerForRemoteNotificationTypes: with a parameter that masks all available types together, including both UIRemoteNotificationTypeNewsstandContentAvailability and UIRemoteNotificationTypeBadge. 3. Register and configure the app for any available push notification service such as Urban Airship or Amazon SNS. 4. Install the app on a device, and ensure that App Badge is enabled in Settings > Notification Center for that app. 4. Have the service send a remote notification payload that includes a "badge" key but does NOT include a "content-available" key. 5. The app's badge is never updated. 6. Remove the UIRemoteNotificationTypeNewsstandContentAvailability flag from the -registerForRemoteNotificationTypes: call and rebuild the app. 7. Repeat step 4. 8. The app's badge is now updated as expected. Expected Results: The app's badge should be updated if the aps payload contains a "badge" key and not a "content-available" key, if the app registered for badge notifications using UIRemoteNotificationTypeBadge. Actual Results: The app's badge is never updated when UIRemoteNotificationTypeNewsstandContentAvailability is passed to -registerForRemoteNotificationTypes:
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!