-
Notifications
You must be signed in to change notification settings - Fork 1.9k
GCM iOS topic: on('notification') not triggered when app in background #806
Comments
@bardu this is the payload you would use on Android:
This is the payload you would use on iOS when using GCM:
It's a pain to send two different notifications for Android and iOS but that's the best I can do at the moment. |
Leveraging GCM topics the my server doesn't know whether the recipient is Android or iOS, or do I miss something? |
@bardu you are not missing anything other than to get push to work properly for Android I've had to force everyone to use the You should probably set it up so that your devices subscribe to different topics, say "foo-ios" and "foo-android" then have your server send the data in the right framework to the two different topics. |
@macdonst I like the idea of using topics to separate iOS and Android users. Is it possible to send notification only to subset of users subscribed to a topic? |
@macdonst So there is noway to send hybrid msg to GCM ? My msg payload: {
"to" : "APA91bHun4MxP5egoKMwt2KZFBaFUH-1RYqx...",
"notification" : {
"body" : "great match!",
"title" : "Portugal vs. Denmark",
"icon" : "myicon"
},
"data" : {
"Nick" : "Mario",
"Room" : "PortugalVSDenmark"
}
} But on Android, on('notification') not triggered when app is running in background. If there is no solution at the moment, Is there road-map to support this feature in next releases?! |
@hungdoan2 currently if you add the |
@macdonst So currently there is no way to get both Android and iOS to work EXCEPT sending different data for iOS and different for Android right? I am glad to hear that you are working on that, do you have some estimate when this feature will be working? Any estimate will help. |
@DamodarSojka Correct and no, I can't provide an estimate as it would only be a wild guess at this point. |
@macdonst i was having problem receiving push notification while in background, just used your example and it started to work again! |
@macdonst Any updates or new thoughts on this? |
Since this is a good workaround for the issue I'm closing it. |
Hi Guys, Is anybody else facing issue with IOS 10.0.2 with push plugin 1.8.3 ? It's not working for me. I am not able to get notification on IOS. Any insight will be helpful. I got stuck with this problem from last 2 days. Regards, |
@PDivya |
@hung-doan : Yes, it is working with my android device as well as with IOS 9.x. I tired downgrading to 1.8.2 but it didn't help. |
This thread has been automatically locked. |
Expected Behaviour
Alert shown on iPhone when receiving push notification with sound and vibration when app is in background.
Note: this works on my Android Samsung S6 Edge
Actual Behaviour
The device seem to receive the push notification (see logs at the bottom) but on('notification') is not triggered.
Reproduce Scenario (including but not limited to)
see payload and sample code below
Steps to Reproduce
see payload and sample code below
Platform and Version iOS 9.2.1, 9.3.1
(Android) What device vendor (e.g. Samsung, HTC, Sony...)
Cordova CLI version and cordova platform version
Plugin version
Sample Push Data Payload
Sample Code that illustrates the problem
Logs taken while reproducing problem
The text was updated successfully, but these errors were encountered: