Open princealirehman1 opened 4 years ago
Experiencing this also. No background notification being sent when soft-closing the app.
same issue with me and the same version of Firebase V7
Is this module compatible with react native firebase cloud messaging
?
Same for me :/ not working. Any solution?
I can vouch iOS isn't working for me either, I have been stuck with debugging for like 2 days now
still same? i am also having the same issue.
Actually whenever I’m switching current application to any other apps, local notification is not working but when I back to current application, It works. I want local notifications to be work in any scenario, within the application and also while I’m switching to other application. Please Help.... here's the lib and version in my app: "@react-native-community/push-notification-ios": "^1.5.0", "react-native-push-notification": "^5.1.1", "react": "16.11.0", "react-native": "0.62.2",
I have local notification issue in iOS => local notification working fine in android for foreground & background, also local notification click event work but In Case of iOS local notification work in only foreground, not in background, also not working click event of notification. I need perfect solution for local notification working fine both iOS & Android, and also working their click event. Help...
Facing the same issue with the basic setup, when the app is in the foreground everything works fine, both presentLocalNotification
and scheduleLocalNotification
, however once I schedule a local notification and soft close the app nothing happens.
I'm facing the same issue receiving notifications on Android either in background or foreground, On iOS getting notifications in the foreground but not in background
the same issue
My issue turned out to be I was generating the ID myself a 32 bit unsigned integer, but somehow it was not correct it was overflowing, after I changed to generate a 31 bit integer, everything started working in a stable manner
same issue, i used firebase react native messaging and onmessage also called, but with ios nothing comes out. even app is closed. i used react-native-push-notification @react-native-community/push-notification-ios @react-native-firebase/messaging.
Still no solution?
I was able to just use the react-native-firebase latest without this push notification library.
Please make sure you send the data correctly in order to trigger the notification.
At my side, I have used the following format:
{ "to": "TOKEN", "data":{ "title":"Some title", "message":"Some text", "vibrate":1, "sound":1, "channelId": "TEST" }, "notification": {. <-- Trigger notification "title":"Some title", "body":"Some text", "sound": "default" }, "content_available":true, <-- Trigger notification required for IOS "priority":"high" }
setBackgroundMessageHandler just handle the message once the app opens due to the notification. It does not trigger when notification is received.
Facing the same issue... When the app is killed(removed from the background) on notification gets triggered after receiveing a notification, but when app is in the background nothing happens.
Still not working guys ? I have the same problem...
Just an FYI as this is pretty difficult to debug due to the way messaging works and the fact you will get different message/system behaviour depending on the message structure.
Below works fairly consistently
Note that i don't have a data
object.
{
"to": "{{myID}}",
"notification": {
"title": "Working Good",
"body": "backgroudn noti",
"badge": "1"
},
"priority": "high",
"badge": "1",
"content_available": true
}
Definitely doesn't trigger background notifications.
Doesn't contain the priority
, badge
, and content_available
properties. This was my original message structure.
{
"to": "myID",
"notification": {
"title": "payload.title1",
"body": "payload.body"
},
"data": {
"link": "payload.link"
},
"apns": {
"payload": {
"aps": {
"mutable-content": 1
}
}
}
}
Might trigger background notifications and badge count. But not always I'm still debuggin issues myself, and i'm actually using a different notification package, but this was such a nightmare, that i fellt the need to share.
Note, that here i have the priority fields and both a notification and data block, i've read in other posts for react native that if you have a notification "AND" a data block that firebase messagings setbackgroundhandler won't trigger. if your using that. But haven't confirmed that yet.
{
"to": "myID",
"notification": {
"title": "payload.title",
"body": "payload.body"
},
"data": {
"link": "payload.link"
},
"apns": {
"payload": {
"aps": {
"mutable-content": 1
}
}
},
"priority":"high",
"badge":"1",
"content_available":true
}
Anyway, my advice if this is a poblem, is to setup postman or some test endpoints with all the possible combinations of message.
@emileswain you just saved my day
Bug report
Summary
I am trying to acheive Push Notifications for both Android & iOS (Foreground & Background). I followed the official firebase docs and was able to run it correctly on Android in all app states. Foreground, Background & Quit it works
But the same thing is only working in Foreground for IOS.
In background what i want is push notification from RestApi. And on foreground I am showing a LocalNotification which is working fine.
No Matter what I do it doesnot trigger the messaging().setBackgroundMessageHandler(async remoteMessage => {console.log('Message handled in the background!', remoteMessage);});
Environment info
react-native info
output:`Package.json'
Reproducible sample code
Library version: ^1.2.2 iOS: 13.4.1