React-native-notifications: Android: notification appears blank

Created on 27 Aug 2019  路  6Comments  路  Source: wix/react-native-notifications

Hi everyone and thanks for this great package!

I successfully managed to install react-native-notifications on iOs and Android, and to send the device token back to my server (Parse Server 3.3.0). Everything works fine on the iOs side of things; however, I am experiencing several issues on Android.

The notification appears blank (no title, no body, just a white notification). When logging my notification on my Android Device, I can access data, though it is a string rather than an object. I guess the above issue comes from the fact that data is as a string rather than an object.
I am using my Parse-Server to send the notifications (guide here)
Notifications work fine in our production app, which is not using react-native-notifications.

Here is the data received by our android clients:

{data: '{"badge":1,"alert":{"title":"OuiRun t\'invite 脿 rejoindre un run !","body":"Rejoins les autres runners de Test Run"},"payload":{"runId":"FIYtqEY192","routeName":"RunDetails"},"title":"OuiRun invites you to a run!","body":"Join the other runners of Test Run"}',
 push_id: 'iZhJKahxmR',
'google.original_priority': 'high',
'google.ttl': 2419200,
google.sent_time': 1566910140762,
 'google.delivered_priority': 'high' }

I managed to make the notification title and body appear by setting a duplicate in our Parse Server code: data is used by iOs, and notification by Android. Is there a way to avoid this?

Parse.Push.send({ where: query, data: { alert: { title: title, body: message }, title: title, body: message, badge: options.badge ? options.badge : "Increment", sound: options.sound, payload: options.payload }, notification: { alert: { title: title, body: message }, title: title, body: message, badge: options.badge ? options.badge : "Increment", sound: options.sound, payload: options.payload } }, { useMasterKey: true });

Many thanks!

馃彋 stale

Most helpful comment

I have to same issue as @shauns. Using remote notifications from AWS, but on Android they appear blank. iOS is working fine.

Anyone who can help me out?

All 6 comments

Same issue with AWS Pinpoint. Token is generated, and the message arrives, but there's no title/body/media. RN60

try using
{
"registration_ids":["Your id's"],
"notification":
{
"title": "Title",
"text": "Your Text",
"sound": "default",
"badge": "1",
"color": "#0072B6"
},
"data": {
"title": "Title",
"body": "Your Text"
}
}

in that way i can see the title and message when app is in background and when it's open

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

The issue has been closed for inactivity.

I have to same issue as @shauns. Using remote notifications from AWS, but on Android they appear blank. iOS is working fine.

Anyone who can help me out?

Any solution for this?

Was this page helpful?
0 / 5 - 0 ratings