New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

Projects
None yet
2 participants
@mauron85

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

This comment has been minimized.

Show comment
Hide comment
@macdonst

macdonst Aug 31, 2015

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.

Member

macdonst commented Aug 31, 2015

@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

This comment has been minimized.

Show comment
Hide comment
@lock

lock bot Jun 5, 2018

This thread has been automatically locked.

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.