Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Question about GCM Notifications and data in the message payload #87

Closed
mauron85 opened this issue Aug 30, 2015 · 2 comments
Closed

Question about GCM Notifications and data in the message payload #87

mauron85 opened this issue Aug 30, 2015 · 2 comments

Comments

@mauron85
Copy link

GCM has two options how payload should look like - data and notifications https://developers.google.com/cloud-messaging/concept-options#notifications_and_data_messages

Data messages format

{
   "to" : "APA91bHun4MxP5egoKMwt2KZFBaFUH-1RYqx...",
   "data" : {
     "Nick" : "Mario",
     "body" : "great match!",
     "Room" : "PortugalVSDenmark"
   },
 }

Notifications format

 {
    "to" : "APA91bHun4MxP5egoKMwt2KZFBaFUH-1RYqx...",
    "notification" : {
      "body" : "great match!",
      "title" : "Portugal vs. Denmark",
      "icon" : "myicon"
    }
  }

I'm using node-gcm which recently added Notifications format, but my cordova app is not recieving this kind of messages. However the data format is working fine.

Question: Is Notifications format supported by phonegap-plugin-push? Is it system level thing? Or phonegap plugin has to support this?

Related question in node-gcm project:
ToothlessGear/node-gcm#150

@macdonst
Copy link
Member

@mauron85 currently the plugin only supports receiving notifications via the data message format but I just pushed a fix so it should be working fine in the 1.2.1 release.

@lock
Copy link

lock bot commented Jun 5, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants