Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android gcm notification payload vs data payload?

According to https://developers.google.com/cloud-messaging/server-ref gcm message can have notification payload or/and data payload What is the difference between these two?

like image 449
andrei g Avatar asked Jun 02 '15 03:06

andrei g


1 Answers

Reading on the link you send it is explained under Payload section

Payload

Optional. If you are including a payload in the message, you use the data parameter to include your custom key/value pairs. The client app handles the data payload for display or other processing purposes.

The notification parameter with predefined options indicates that GCM will display the message on the client app’s behalf if the client app implements GCMListenerService on Android, or if the notification message is sent to an iOS device. This applies for both HTTP and XMPP.

The app server can send a message including both notifications and data payloads. In such cases, GCM handles displaying the notification payload and the client app handles the data payload.

See the Server Reference for details on sending and receiving messages.

like image 165
Lasse Avatar answered Oct 24 '22 03:10

Lasse