I am creating a Phonegap application - currently for Android - that uses Onesignal to handle push notifications. Creating the main application was not too complicated. In the context of the application, the user really does not need to view the notification.
I require to be able to handle the message payload in a JavaScript application. This is not a problem if I am ready to wait until the user clicks the notification icon, the [notificationopenedcallback] event is fired at that moment, and I am free to do what I like with the payload. 1
Nice, but not enough. What I need to do is to manipulate the JavaScript payload when a notification arrives - not at some point in the future when the user clicks the notification icon.
It’s not clear to me that this can be done - perhaps because there is no way to execute JS code for the application that was founded. If this is true, can I somehow work around this problem by writing my own application?
I would really appreciate any help with this.
I think you will need to write your own Android application if you want to handle push notifications reliably as they arrive.
phonegap-plugin-push push- Cordova, push-. . , # 806
( ) , , . phonegap-plugin-push , iOS, Android Windows, .
: , push- .
, push- . JS .
, , , BroadcastReceiver. onReceive.
, , . , OneSignal . V4, YMMV.
: , , - , , Google, , , OneSignal.
, , - . AAR, . , AAR . , , , . , JS. . registerReceiver JS.