Closed SchwarzerSchnee closed 5 years ago
I also experience similar issue.
I sent a cloud message from my own server on android, onMessage is trigger on ios, onNotification is trigger instead, onMessage never trigger
I can receive data only message in IOS when app is in foreground but unable to receive data only message in IOS when the app is closed and there is no info regarding the same in the docs also.
@shubham1164 about background on iOS there is a not which specifies only Android:
https://rnfirebase.io/docs/v5.x.x/messaging/receiving-messages
on the 4rth step. Maybe its this.
For me, it happened otherwise. @kosintop, it triggered onNotifications instead of onMessage. And right now (without any apparent change, not even onMessage will trigger).
Edit: Was missing iOS authentification keys (https://firebase.google.com/docs/cloud-messaging/ios/first-message#upload_your_apns_authentication_key)
In case it wasn't clear from the starting post, the issue happens on the HTTP v1 API only. It's working fine with the legacy HTTP API. We would strongly prefer not to use legacy in our project though...
I am now using Voip notification for IOS and successfully able to trigger the notification on the IOS even in the closed IOS app
Hello π, this issue has been automatically marked as stale because it has not had activity for quite some time. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.
onMessage not working on ios
Hello π, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?
This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.
onMessage is triggered on iOS on foreground only. iOS manages displaying notifications by itself when your app is on background/closed. After removing the notification object, add the following to your message object:
apns: {
payload: {
aps: {
badge: unreadMessageCount,
alert: {
title,
body
}
}
}
}
I know it is a late response, but I hope it will help somebody else who lands on this issue.
HTTP v1 POST body:
Code in my app:
The app is running in foreground. I am finding no sources online that claim this shouldn't work.
Environment
React Native
version:React Native Firebase
library version:Firebase
module(s) you're using that has the issue:TypeScript
?N/A
ExpoKit
?ExpoKit
N/A