Skip to content
This repository was archived by the owner on Jan 23, 2021. It is now read-only.

Commit 4b4fec3

Browse files
added payload body features : category, ledColor, actions; debug log payload; payload generation support null values
1 parent aa08077 commit 4b4fec3

File tree

3 files changed

+361
-66
lines changed

3 files changed

+361
-66
lines changed

Resources/Model/AndroidAction.php

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
<?php
2+
3+
namespace Reliefapps\NotificationBundle\Resources\Model;
4+
5+
6+
class AndroidAction
7+
{
8+
/**
9+
* @var string
10+
* Optional. The name of a drawable resource to use as the small-icon. The name should not include the extension.
11+
*/
12+
private $icon;
13+
14+
/**
15+
* @var string
16+
* Required. The label to display for the action button.
17+
*/
18+
private $title;
19+
20+
/**
21+
* @var string
22+
* Required. The function to be executed or the event to be emitted when the action button is pressed. The function must be accessible from the global namespace. If you provide myCallback then it amounts to calling window.myCallback. If you provide app.myCallback then there needs to be an object call app, with a function called myCallback accessible from the global namespace, i.e. window.app.myCallback. If there isn't a function with the specified name an event will be emitted with the callback name.
23+
*/
24+
private $callback;
25+
26+
/**
27+
* @var boolean
28+
* Optional. Whether or not to bring the app to the foreground when the action button is pressed. (Default true)
29+
*/
30+
private $foreground;
31+
32+
/**
33+
* @var boolean
34+
* Optional. Whether or not to provide a quick reply text field to the user when the button is clicked. (Default false)
35+
*/
36+
private $inline;
37+
38+
public function __construct()
39+
{
40+
$this->icon = null;
41+
$this->title = null;
42+
$this->callback = null;
43+
$this->foreground = null;
44+
$this->inline = null;
45+
}
46+
47+
public function toArray(){
48+
return array(
49+
"icon" => $this->getIcon(),
50+
"title" => $this->getTitle(),
51+
"callback" => $this->getCallback(),
52+
"foreground" => $this->getForeground(),
53+
"inline" => $this->getInline(),
54+
);
55+
}
56+
57+
/**
58+
* Get the value of Icon
59+
*
60+
* @return string
61+
*/
62+
public function getIcon()
63+
{
64+
return $this->icon;
65+
}
66+
67+
/**
68+
* Set the value of Icon
69+
*
70+
* @param string icon
71+
*
72+
* @return self
73+
*/
74+
public function setIcon($icon)
75+
{
76+
$this->icon = $icon;
77+
78+
return $this;
79+
}
80+
81+
/**
82+
* Get the value of Title
83+
*
84+
* @return string
85+
*/
86+
public function getTitle()
87+
{
88+
return $this->title;
89+
}
90+
91+
/**
92+
* Set the value of Title
93+
*
94+
* @param string title
95+
*
96+
* @return self
97+
*/
98+
public function setTitle($title)
99+
{
100+
$this->title = $title;
101+
102+
return $this;
103+
}
104+
105+
/**
106+
* Get the value of Callback
107+
*
108+
* @return string
109+
*/
110+
public function getCallback()
111+
{
112+
return $this->callback;
113+
}
114+
115+
/**
116+
* Set the value of Callback
117+
*
118+
* @param string callback
119+
*
120+
* @return self
121+
*/
122+
public function setCallback($callback)
123+
{
124+
$this->callback = $callback;
125+
126+
return $this;
127+
}
128+
129+
/**
130+
* Get the value of Foreground
131+
*
132+
* @return boolean
133+
*/
134+
public function getForeground()
135+
{
136+
return $this->foreground;
137+
}
138+
139+
/**
140+
* Set the value of Foreground
141+
*
142+
* @param boolean foreground
143+
*
144+
* @return self
145+
*/
146+
public function setForeground($foreground)
147+
{
148+
$this->foreground = $foreground;
149+
150+
return $this;
151+
}
152+
153+
/**
154+
* Get the value of Inline
155+
*
156+
* @return boolean
157+
*/
158+
public function getInline()
159+
{
160+
return $this->inline;
161+
}
162+
163+
/**
164+
* Set the value of Inline
165+
*
166+
* @param boolean inline
167+
*
168+
* @return self
169+
*/
170+
public function setInline($inline)
171+
{
172+
$this->inline = $inline;
173+
174+
return $this;
175+
}
176+
177+
}

0 commit comments

Comments
 (0)