Sometimes you might want to send push notifications to an application that does not have the Pushwoosh SDK integrated. While pushes will technically reach the device (if the FCM token is valid), the application might not be able to display them correctly, often resulting in empty notifications without text.
Here is why this happens and how to handle it:
- FirebaseMessagingService: To handle pushes on Android, your app must implement a
FirebaseMessagingService. The Pushwoosh SDK adds its own automatically. Without it, you must configure this service manually. - Data vs. Message Notifications: FCM supports two types of notifications. Message notifications contain the text and title in reserved keys and are handled by FCM automatically. Data notifications send the entire payload as custom keys.
- Pushwoosh Payload Formatting: Pushwoosh sends only Data messages from the backend. Since the native application does not inherently know under which key the text, title, or image is stored, a custom
FirebaseMessagingServicemust manually parse the payload. The Pushwoosh SDK exists specifically to handle this "decoding" out-of-the-box. Without the SDK, you will have to manually parse the Pushwoosh payload in your application code.
Comments
0 comments
Please sign in to leave a comment.