Guidelines for raw notifications (Windows Store apps)
This topic describes best practices for using raw push notifications. It also lists requirements, related to raw notifications, for your app to be accepted in the Windows Store.
Note This topic is specific to raw notifications. Your app must also follow the best practices described in Guidelines for push notifications.
- Transmit the smallest amount of information in the raw notification that you can. Use the notification to indicate that more information is available for the app to download from its cloud service, rather than including that information in the notification. Here are some examples:
- Use the raw notification as a trigger to initiate a file download. For example, if a user purchases an e-book online, send a raw notification to the user's reading app to trigger the download of the new book.
- Use the raw notification to notify a communication app that there is an incoming instant message or phone call. The communication app can then establish the connection and use a local toast notification to get the user's attention.
- Use the raw notification to coordinate synchronization actions between the client and the cloud service, such as triggering the sync of the most recently read page of a book in a reader app.
- Keep your notification's payload under 5 KB. Payloads over 5 KB will be rejected by Windows Push Notification Services (WNS).
- Encode any binary data in the notification as base64 before it is included in a raw notification. This guarantees that the content will not be encoded incorrectly in transit, and can be retrieved successfully by the client.
Consider using other methods of communication before you choose background tasks that are triggered by raw notifications. Most apps should not need to implement background tasks. For an app to use background tasks, it must be one of the small number of apps that are allowed to be pinned to the lock screen. Your app will compete for those slots, and the user has the ultimate control over the apps that occupy them. Your app is not guaranteed to be one of them. By using another mechanism to implement communication in your app, such as standard push notifications or toast updates, you prevent the user from having to choose between your app and others that they care about.
Some alternatives to background tasks:
- To get the user's attention, send a toast push notification.
- To update a tile, use a tile push notification.
- Do not use raw notifications to stream information to an app by including small portions in serial notifications. Raw notifications should be sent only in response to events that are triggered on the cloud service.
- Do not send raw notifications from a cloud service just to keep a background task running, which is an abuse of the user's battery life. The raw notification must communicate useful information to the app.
- Do not send raw notifications at a rate that causes the associated background task to exceed its resource quota. For more information, see Guidelines for background tasks.
- Do not include a zero-sized payload content in a raw notification. Raw notifications without a payload are dropped by WNS and will not be delivered to your app.
For general Windows Store requirements, see Certification requirements for Windows apps.
- Raw notifications sample
- Raw notification overview
- Quickstart: Creating and registering a raw notification background task
- Quickstart: Intercepting push notifications for running apps
Build date: 11/16/2013