You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.
I'd like to process some notifications in my app even if the user didn't click on it to open my app.
The .on('notification') works, but I only get the payload when either :
The app is opened via a click on the notification
The app was already opened and in foreground.
Why doesn't the plugin execute PushPlugin.sendExtras(extras); on every message received (at least on the Android version) ?
Wouldn't it be better to send the payload to the app, show a notification and call a second .on('notification') when the user actually opens the notification ?
That way we could send push-to-sync requests.
Or am I missing something ?
The text was updated successfully, but these errors were encountered:
One is that when an app is not running at all on android (was never opened, or was forcedly closed through the launcher or "alt-tab") the event handlers are non-existing, and we still need to find a way to restore them in this scenario so that notification events can fire even if the app is completely dead. See this issue, this one also and this other one, they explain better the situation, and why it's still not available.
The other is that we don't have a dedicated event for when a notification is received on the device in general, but only when it's clicked by the user. There is one type of notification hereby called background notifications that gives you the option to skip from receive -> display notification -> run click handler -> trigger 'notification' to receive -> trigger 'notification' but in this case no notification will be shown to the user at all. The topic on splitting the events has been brought up on this PR and on this comment.
You can always give your input on these options or simply +1 them so @macdonst knows what to prioritize.
I'd like to process some notifications in my app even if the user didn't click on it to open my app.
The
.on('notification')
works, but I only get the payload when either :Why doesn't the plugin execute
PushPlugin.sendExtras(extras);
on every message received (at least on the Android version) ?Wouldn't it be better to send the payload to the app, show a notification and call a second
.on('notification')
when the user actually opens the notification ?That way we could send push-to-sync requests.
Or am I missing something ?
The text was updated successfully, but these errors were encountered: