From 5690f4869a979c2d4fd70d89315a0a9c3b30b0dc Mon Sep 17 00:00:00 2001 From: jseverinson Date: Sun, 8 Oct 2017 10:13:44 +0200 Subject: [PATCH] Add title and subtitle for iOS Documentation for /createMessage allows for use of 'ios_title' and 'ios_subtitle'. Added this to the IOS model. See: http://docs.pushwoosh.com/docs/createmessage --- .../Pushwoosh/Model/Notification/IOS.php | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/main/php/Gomoob/Pushwoosh/Model/Notification/IOS.php b/src/main/php/Gomoob/Pushwoosh/Model/Notification/IOS.php index 5643814..fc49dad 100644 --- a/src/main/php/Gomoob/Pushwoosh/Model/Notification/IOS.php +++ b/src/main/php/Gomoob/Pushwoosh/Model/Notification/IOS.php @@ -35,6 +35,8 @@ class IOS implements \JsonSerializable private $sound; private $ttl; private $trimContent; + private $title; + private $subtitle; /** * Utility function used to create a new IOS instance. @@ -91,7 +93,16 @@ public function isApnsTrimContent() public function isTrimContent() { return $this->trimContent; - + } + + public function getTitle() + { + return $this->title; + } + + public function getSubtitle() + { + return $this->subtitle; } /** @@ -108,6 +119,8 @@ public function jsonSerialize() isset($this->sound) ? $json['ios_sound'] = $this->sound : false; isset($this->ttl) ? $json['ios_ttl'] = $this->ttl : false; isset($this->trimContent) ? $json['ios_trim_content'] = intval($this->trimContent) : false; + isset($this->title) ? $json['ios_title'] = $this->title : false; + isset($this->subtitle) ? $json['ios_subtitle'] = $this->subtitle : false; return $json; @@ -179,4 +192,18 @@ public function setTrimContent($trimContent) return $this; } + + public function setTitle($title) + { + $this->title = $title; + + return $this; + } + + public function setSubtitle($subtitle) + { + $this->subtitle = $subtitle; + + return $this; + } }