-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Sending one unique push for iOS and Android #2087
Comments
@arimk No, you are not missing something. If you read: You should get an overview of why the plugin requires everything in the With iOS we are using FCM libs directly from Google which require the push in I really wish I could make this consistent but I can't. |
Thnaks @macdonst I still don't really get why when you have data and notification at the same time, the on('notification') handler is not called. It should be. Thanks ! |
@arimk it should be but in testing various version of Android/Play Services I haven't found it to be 100% consistent. As well if you put anything in Your suggestion of having this front and centre in the readme is a good one. I'm going to re-open this issue until I get a chance to add it to the docs. Thanks for the feedback. |
@arimk can you give the README a quick look over and see if this makes sense? |
@macdonst It does! Maybe just adding something about having to retreive platform information by yourself as it is not the plugin's role to do it? |
This thread has been automatically locked. |
Expected Behaviour
Everything working
Actual Behaviour
Working only on one platform at a time...
Reproduce Scenario (including but not limited to)
Read underneath
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
All
(Android) What device vendor (e.g. Samsung, HTC, Sony...)
All
Cordova CLI version and cordova platform version
Last
Plugin version
Last
Hi,
It is maybe not an issue but a clarification.
I am using only FCM for everything, last version of the plugin, on an ionic app
Reading the (otherwise very clear) docs, I am wondering something.
In the payload doc : https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/PAYLOAD.md
It is explained that for android, you need to send the following, to be able to get the on(notification) handler working on android :
{ "data" : { "title": "Test Notification", "body": "This offer expires at 11:30 or whatever", "notId": 10, "surveyID": "ewtawgreg-gragrag-rgarhthgbad" } }
and it is also written to never use the "notification" part in the payload, if you actually want the handler to work.
Now this is clear and it is working on Android.
But on iOS, it also clearly written to do exactly the opposite :
{ "registration_ids": ["my device id"], "notification": { "title": "My Title", "body": "My message" } "data": { "key1": "data 1", "key2": "data 2" } }
So the big issue here is, the whole idea of using FCM is not having to handle (on a high level) the differences between iOS and Android.
Now I understand that it is totally the opposite that is needed. You have to know exactly which type of device is your user using (as the registration callback does not give it, you have to do it on your own).
That also means that if you want to send a notification to a FCM group (like "all users") you have to do it twice, one for all Android users, one for all iOS users.
Am I missing something?
Shouldn't it be explained in the documentation somewhere?
There is no way to make an FCM notification working for both environnement at once?
Thanks, no sure if it is the right place but it seems extremely strange from a user perspective.
The text was updated successfully, but these errors were encountered: