Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions library/CodeMonkeysRu/GCM/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ class Message
*/
private $restrictedPackageName = null;

/**
* On iOS, use this field to represent content-available in the APNS payload. When a
* notification or message is sent and this is set to true, an inactive client app is
* awoken. On Android, data messages wake the app by default.
*
* Optional.
*
* @var bool
*/
private $contentAvailable = true;

/**
* Allows developers to test their request without actually sending a message.
*
Expand Down Expand Up @@ -201,4 +212,14 @@ public function setDryRun($dryRun)
return $this;
}

public function getContentAvailable()
{
return $this->contentAvailable;
}

public function setContentAvailable($contentAvailable)
{
$this->contentAvailable = $contentAvailable;
return $this;
}
}
1 change: 1 addition & 0 deletions library/CodeMonkeysRu/GCM/Sender.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ private function formMessageData(Message $message)
'time_to_live' => 'getTtl',
'restricted_package_name' => 'getRestrictedPackageName',
'dry_run' => 'getDryRun',
'content_available' => 'getContentAvailable',
);

foreach ($dataFields as $fieldName => $getter) {
Expand Down