Closed luisalvarez closed 7 years ago
@luisalvarez you have to extend ZendService\Google\Gcm\Message
implementation to add this, you can have a look at a project of mine:
https://github.com/juliangut/tify/blob/master/src/Adapter/Gcm/GcmMessage.php#L136
Be aware that the content provided on 'notification' payload will be used by the devices to automatically create the notification (at least on iOS)
Hello i working on push notification server i just want to use GCM for both IOS and Android but on IOS the format of the message need a notification key.
public function toJson() { $json = array(); if ($this->registrationIds) { $json['registration_ids'] = $this->registrationIds; } if ($this->collapseKey) { $json['collapse_key'] = $this->collapseKey; } if ($this->data) { $json['data'] = $this->data; if (isset($this->data[notification'])) { $json['notification'] = $this->data['notification']; } } if ($this->delayWhileIdle) { $json['delay_while_idle'] = $this->delayWhileIdle; } if ($this->timeToLive != 2419200) { $json['time_to_live'] = $this->timeToLive; } if ($this->restrictedPackageName) { $json['restricted_package_name'] = $this->restrictedPackageName; } if ($this->dryRun) { $json['dry_run'] = $this->dryRun; } return Json::encode($json); }
There is example of something work for what it need to do to accomplish this