- Threads Versus Background Tasks
- Uploads and Downloads
- Audio
- Lock Screen Tasks
- Timer
- Conditions
- Raw Push Notifications
- Control Channel
- System Events
- Summary
Raw Push Notifications
Windows Store apps support several types of push notifications. The three main notification types (badge, tile, and toast) are automatically handled for you by the Windows Runtime. Even if your app is not running in the foreground, Windows will update your tile or set the badge for the app when it receives one of these notification types.
A fourth type of notification is a raw notification. The badge, tile, and toast forms must be formatted as XML. Raw notifications can be any string format: XML, JSON, or even plain text. They are designed for sending small (the payload must be less than 5KB) messages to your app for you to process however you like.
The Windows Runtime doesn’t know what you will do with raw notifications so it is unable to process them when your app is not running. To handle these types of notifications, you must register a background task that uses a special trigger called the PushNotificationTrigger. Using this trigger, you can parse the payload of a raw notification offline.