This is done on the device side, not on the server.
After completing the full implementation of Google Cloud Messaging
Consider creating Notifications on a device.
Here is a snippet representing a notification with the buttons specified in the second link:
Notification notification = new Notification.Builder(context)
// Show controls on lock screen even when user hides sensitive content.
.setVisibility(Notification.VISIBILITY_PUBLIC)
.setSmallIcon(R.drawable.ic_stat_player)
// Add media control buttons that invoke intents in your media service
.addAction(R.drawable.ic_prev, "Previous", prevPendingIntent) //
.addAction(R.drawable.ic_pause, "Pause", pausePendingIntent) //
.addAction(R.drawable.ic_next, "Next", nextPendingIntent) //
// Apply the media style template
.setStyle(new Notification.MediaStyle()
.setShowActionsInCompactView(1 )
.setMediaSession(mMediaSession.getSessionToken())
.setContentTitle("Wonderful music")
.setContentText("My Awesome Band")
.setLargeIcon(albumArtBitmap)
.build();