E
E
Eugene2019-06-25 16:58:22
Android
Eugene, 2019-06-25 16:58:22

How to open app and execute some method when notification is clicked (phonegap-plugin-push)?

I use the phonegap-plugin-push 2.2.3 plugin in the application in the project on cordova android 7.1.4. I send a request from the console without the notification parameter - only data - in it I pass the data that needs to be processed when clicked. the request is something like this:

http post https://fcm.googleapis.com/fcm/send Authorization:key=AAAASSxxxxxxxx <<<'{"to": "user-device-token", "priority": "high","data":{"title":"new message","count": 12, "url": "/channels/xxxxx"}}'

So far, it turns out that either the data is not processed at all, or it is processed, but immediately upon receipt of a notification - if we specify the content-available true parameter in the request.
The application can be opened when clicking on a push notification only if the push request contains a notification parameter, but then the badge (count) icon is not set.
I tried to change the AndroidLaunchMode parameter in the application config to different ones - nothing changes.
I ask for help, because after a day of digging in this mess, the head will soon burst))

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question