Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sygnal only sending data-only FCM messages #366

Open
msl2000 opened this issue Mar 27, 2024 · 6 comments
Open

Sygnal only sending data-only FCM messages #366

msl2000 opened this issue Mar 27, 2024 · 6 comments

Comments

@msl2000
Copy link

msl2000 commented Mar 27, 2024

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..

@MichalNemec
Copy link

when you get data notification, you can create notification from that data, its actually a good thing from my pov.

@msl2000
Copy link
Author

msl2000 commented Apr 1, 2024

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.

@devonh
Copy link
Contributor

devonh commented Jun 21, 2024

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.

@tusharbhambere
Copy link

Any Update?

@otech47
Copy link

otech47 commented Oct 3, 2024

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

@vanyasem
Copy link

vanyasem commented Nov 1, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants