- Home
- Documentation
- Client Setup
- iOS
- Create App
- Get the SDK
- Enable Capability
- Register Devices
- Handle Notifications
- Subscribe to Topics
- Setup APNs Authentication
- Send Test Notification
- Android
- Create App
- Get the SDK
- Register Devices
- Modify Launcher Activity
- Modify AndroidManifest
- Setup BroadcastReceiver
- Parse Notification Data
- Subscribe to Topics
- Send Test Notification
- Web Push
- Create App
- Get the SDK
- Register Visitors
- Handle Notifications
- Subscribe to Topics
- Send Test Notification
- Additional Platforms
- Ionic
- Flutter
- Python
- macOS
- Angular
- Electron
- Cordova
- Capacitor
- PhoneGap
- React Native
- MAUI (Android)
- Xamarin (Android)
- Migration Guides
- Backend Setup
-
API Reference - SDK Reference
- Additional Resources
Got Feedback?
We'd love to hear what you have to say about our documentation. Let us know how we can improve it.
Parse Notification Data
Any payload data that you send with your push notifications is made available to your app via the Intent
extras of your PushReceiver
class.
Please select your Android project type for the appropriate instructions:
If you were to send a push notification with the following payload:
{"id": 1, "success": true, "message": "Hello World"}
Then you'd be able to retrieve each value from within your PushReceiver.java
PushReceiver.kt
file like so:
int id = intent.getIntExtra("id", 0);
String message = intent.getStringExtra("message");
boolean success = intent.getBooleanExtra("success", false);
val id = intent.getIntExtra("id", 0)
val message = intent.getStringExtra("message")
val success = intent.getBooleanExtra("success", false)
Note: Unlike GCM / FCM, we do not stringify your payload data, except if you supply JSON objects or arrays. This means that if you send {"id": 3}
, you'd retrieve that value in the receiver using intent.getIntExtra("id", 0)
.