evollu / evollu/react-native-fcm

Notification not showing when the message sent to topic

Open
#883 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.7k
Forks
661
PR merge metrics
No merged PRs in 30d

Description

Hi @evollu , When sending the message to topics the Notification isn't showing up, but the data is received.

I have tried sending the message with this:
```js
fetch('https://fcm.googleapis.com/fcm/send', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'key=AIzaSyD---'
},
body: JSON.stringify({
"to":"/topics/news",
"data": {
"body": "test body",
"title": "test title",
"color":"#00ACD4",
"priority":"high",
"icon":"ic_launcher",
"sound": "default",
"show_in_foreground": true
}
})
})
```

But when adding the data to the custom_notification the notification show up.
```js
fetch('https://fcm.googleapis.com/fcm/send', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'key=AIzaSyD---'
},
body: JSON.stringify({
"to":"/topics/news",
"data": {
"custom_notification": {
"body": "test body",
"title": "test title",
"color":"#00ACD4",
"priority":"high",
"icon":"ic_launcher",
"sound": "default",
"show_in_foreground": true
}
}
})
})
```

1. RN 0.50.3 and react-native-fcm 14.1.3
2. Android 4.4.4 Emulator
3. app running in foreground & background

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.