2

I am using GCM to deliver notifications to Android and iOS devices. What I am looking for is to send in the same downstream message a silent push for both platforms. I have tried with this message

"content_available":true,
"data": 
{
    //My data here       
},

As you can see, no notification key is sended, iOS works fine and we are receiving push in the background but Android shows my app icon at the top bar and it is not calling the GCM receiver.

If I set content_available to false, Android works fine but not in iOS (either background or foreground).

What I supposed to do? Send to my server the OS of each device and send a different message for each system?

I have also tried to set aps dictionary in data payload, but still the same.

Thanks in advance.

  • Here is a workaround if no-one else can solve your problem: Have all iOS devices register for GCM and subscribe to the topic "everyone-ios", and Android devices sign up for the "everyone-android" topic. Then you can send just two (slightly different) messages to all your app instances with one bit of code. See https://developers.google.com/cloud-messaging/topic-messaging – Magnus Smith Feb 10 '16 at 22:07
  • Good idea, I will try it. I finaly decide to send the OS con each device login. When I need to send the push notificación from the server the OS field is used to differentiate wich message should I use. – Miguel Aboratec Feb 11 '16 at 23:22
  • Finally we set the os at the time of login and so we can differentiate them. We send one payload to iOS and other slightly different to Android. – Miguel Aboratec Jun 03 '16 at 08:48

0 Answers0