Open msl2000 opened 8 months ago
when you get data notification, you can create notification from that data, its actually a good thing from my pov.
when you get data notification, you can create notification from that data, its actually a good thing from my pov.
Only problem is that I occasionally lose data only notification when the app is starting up in the background. very prevalent in iOS even though I create a headless app.
There is a way to specify a notification
field for all FCM notifications.
To do so you would add an entry in the config for a gcm pusher like this:
fcm_options:
notification:
body: "test body"
However, this would apply the same to every notification sent to devices that fall under that pusher.
There is currently no way to specify notification
field values on a per device basis.
Any Update?
need this as well for push notifications to work in newer versions of iOS. data-only is not enough to get reliable notifications in the background
I totally agree with @otech47
data-only pushes are severely throttled on iOS in the background. You can expect to get throttled (which equates to all further data-only pushes being ignored completely) after only 10 (!) pushes. The throttling is put in place for about an hour.
In addition, for data-only pushes to even work in the first place, a user has to have "Background App Refresh" enabled, which is not traditionally associated with push notifications, and is commonly disabled globally on users devices.
In addition to that, data-only pushes are only handled if the app is running in some way in the background. If a user kills the app, or if the OS itself kills the app (due to limited memory, or after a device has rebooted, or after installing an update), data pushes will not be handled unless the user launches the app manually again.
The same constraints do not apply to proper notifications that include a "notification"
body.
Android does not suffer from the same limitations, so having data-only pushes on Android is a perfectly acceptable solution. I agree with @MichalNemec, that for Android this approach might be preferred. But that's not the case for iOS.
There are a couple of alternative push gateway implementations that address the issue, but unfortunately they lack in some other way (for example by not supporting VOIP pushes, or Web pushes): https://github.com/famedly/hedwig, https://github.com/krille-chan/fluffygate
Hi all,
I am trying to receive notifications to a react native app using FCM as the provider for both iOS and android.
I noticed that Sygnal seem to only be sending data-only messages and does not include the notification payload.
Am I missing something or this actually built this way? How would we send the notification payload. Any help would be appreciated..