Open ahlidap opened 8 years ago
@ahlidap yeah, that won't work. When the Android OS sees the 'notification' object in your push data it will take over and do it's own handling of the incoming push object. In order for this plugin to works it's magic, i.e. setup JS call backs properly, the push should not include a notification
object. Everything should be in data
.
You'll have to segment your users between iOS and Android then send separate pushes.
+1
I'm also using the same payload for both. Its working for android but not for iOS
"registration_ids" : tokens, "collapse_key":"score_update", "data" : { "message":params.alertData.message, "title" : "myapp", "pageId" : "notifications", "notId" : notId, "timeStamp" : new Date().getTime() }
@techSavvySaahil yes, I am aware of the problem see my earlier answer. This is an enhancement I want to be able to provide.
Expected Behaviour
Use same request to GCM Service, to send push to both Android and iOS
Actual Behaviour
I was able to use same request to send push messages to both platforms some days ago, but now I can't do it anymore.
"notification" object in JSON (for iOS devices) is overriding the "data" object for Android.
Steps to Reproduce
Sending this will result in receiving a notification with title "my title iOS" and message "my message iOS" on both iOS and Android
Platform and Version
Android 4.2.2, 4.4, .5.1.1
Sample Push Data Payload
Stated above