evollu / evollu/react-native-fcm

FCMEvent.Notification can trigger but no notification in Android

Open
#592 23 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Java
Stars
1.7k
Forks
661
PR merge metrics
No merged PRs in 30d

Description

I am testing with the example code, I can trigger FCMEvent.Notification successfully, but never display a notification (for both foreground and background).

ps: The presentLocalNotification is working perfectly.

RN version: 0.45.1
Platform: Android emulator

below is the code,
`sendNotification(token) {
let body = {
"to": token,
"notification":{
"title": "Simple FCM Client",
"body": "This is a notification with only NOTIFICATION.",
"sound": "default"
},
"priority": 10
}
if(Platform.OS === 'android'){
body = {
"to": token,
"data":{
"custom_notification": {
"title": "Simple FCM Client",
"body": "This is a notification with only NOTIFICATION.",
"sound": "default",
"click_action": "fcm.ACTION.HELLO"
}
},
"priority": 10
}
}
this._send(JSON.stringify(body), "notification");
}`

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.