GTNotification.php
6.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<?php
class GTNotification extends GTApiRequest
{
/**
* 第三方厂商通知标题,长度 ≤ 50
*/
private $title;
/**
* 第三方厂商通知内容,长度 ≤ 256
*/
private $body;
//长文本消息内容,通知消息+长文本样式,与big_image二选一,两个都填写时报错,长度 ≤ 512
private $bigText;
//大图的URL地址,通知消息+大图样式, 与big_text二选一,两个都填写时报错,长度 ≤ 1024
private $bigImage;
//通知的图标名称,包含后缀名(需要在客户端开发时嵌入),如“push.png”,长度 ≤ 64
private $logo;
//通知图标URL地址,长度 ≤ 256
private $logoUrl;
//通知渠道id,长度 ≤ 64
private $channelId;
//通知渠道名称,长度 ≤ 64
private $channelName;
/** @var 设置通知渠道重要性(可以控制响铃,震动,浮动,闪灯等等)
* android8.0以下
* 0,1,2:无声音,无振动,不浮动
* 3:有声音,无振动,不浮动
* 4:有声音,有振动,有浮动
* android8.0以上
* 0:无声音,无振动,不显示;
* 1:无声音,无振动,锁屏不显示,通知栏中被折叠显示,导航栏无logo;
* 2:无声音,无振动,锁屏和通知栏中都显示,通知不唤醒屏幕;
* 3:有声音,无振动,锁屏和通知栏中都显示,通知唤醒屏幕;
* 4:有声音,有振动,亮屏下通知悬浮展示,锁屏通知以默认形式展示且唤醒屏幕;
*/
private $channelLevel;
/**
* @see com.gt.sdk.dto.CommonEnum.ClickTypeEnum
* 点击通知后续动作,
* 目前支持5种后续动作,
* intent:打开应用内特定页面,
* url:打开网页地址,
* payload:启动应用加自定义消息内容,
* startapp:打开应用首页,
* none:纯通知,无后续动作
*/
private $clickType;
/**
* 点击通知打开应用特定页面,长度 ≤ 2048;
* 示例:intent:#Intent;component=你的包名/你要打开的 activity 全路径;S.parm1=value1;S.parm2=value2;end
*/
private $intent;
/**
* 点击通知打开链接,长度 ≤ 1024
*/
private $url;
/**
* 点击通知加自定义消息,长度 ≤ 3072
*/
private $payload;
/**
* 消息覆盖使用,两条消息的notify_id相同,新的消息会覆盖老的消息
*/
private $notifyId;
//自定义铃声,请填写文件名,不包含后缀名(需要在客户端开发时嵌入),个推通道下发有效,客户端SDK最低要求 2.14.0.0
private $ringName;
/** @var 角标,
* 必须大于0, 个推通道下发有效
* 此属性目前仅针对华为 EMUI 4.1 及以上设备有效
* 角标数字数据会和之前角标数字进行叠加;
* 举例:角标数字配置1,应用之前角标数为2,发送此角标消息后,应用角标数显示为3。
* 客户端SDK最低要求 2.14.0.0
*/
private $badgeAddNum;
public function getTitle()
{
return $this->title;
}
public function setTitle($title)
{
$this->title = $title;
$this->apiParam["title"] = $title;
}
public function getBody()
{
return $this->body;
}
public function setBody($body)
{
$this->body = $body;
$this->apiParam["body"] = $body;
}
public function getBigText()
{
return $this->bigText;
}
public function setBigText($bigText)
{
$this->bigText = $bigText;
$this->apiParam["big_text"] = $bigText;
}
public function getBigImage()
{
return $this->bigImage;
}
public function setBigImage($bigImage)
{
$this->bigImage = $bigImage;
$this->apiParam["big_image"] = $bigImage;
}
public function getLogo()
{
return $this->logo;
}
public function setLogo($logo)
{
$this->logo = $logo;
$this->apiParam["logo"] = $logo;
}
public function getLogoUrl()
{
return $this->logoUrl;
}
public function setLogoUrl($logoUrl)
{
$this->logoUrl = $logoUrl;
$this->apiParam["logo_url"] = $logoUrl;
}
public function getChannelId()
{
return $this->channelId;
}
public function setChannelId($channelId)
{
$this->channelId = $channelId;
$this->apiParam["channel_id"] = $channelId;
}
public function getChannelName()
{
return $this->channelName;
}
public function setChannelName($channelName)
{
$this->channelName = $channelName;
$this->apiParam["channel_name"] = $channelName;
}
public function getChannelLevel()
{
return $this->channelLevel;
}
public function setChannelLevel($channelLevel)
{
$this->channelLevel = $channelLevel;
$this->apiParam["channel_level"] = $channelLevel;
}
public function getClickType()
{
return $this->clickType;
}
public function setClickType($clickType)
{
$this->clickType = $clickType;
$this->apiParam["click_type"] = $clickType;
}
public function getIntent()
{
return $this->intent;
}
public function setIntent($intent)
{
$this->intent = $intent;
$this->apiParam["intent"] = $intent;
}
public function getUrl()
{
return $this->url;
}
public function setUrl($url)
{
$this->url = $url;
$this->apiParam["url"] = $url;
}
public function getPayload()
{
return $this->payload;
}
public function setPayload($payload)
{
$this->payload = $payload;
$this->apiParam["payload"] = $payload;
}
public function getNotifyId()
{
return $this->notifyId;
}
public function setNotifyId($notifyId)
{
$this->notifyId = $notifyId;
$this->apiParam["notify_id"] = $notifyId;
}
public function getRingName()
{
return $this->ringName;
}
public function setRingName($ringName)
{
$this->ringName = $ringName;
$this->apiParam["ring_name"] = $ringName;
}
public function getBadgeAddNum()
{
return $this->badgeAddNum;
}
public function setBadgeAddNum($badgeAddNum)
{
$this->badgeAddNum = $badgeAddNum;
$this->apiParam["badge_add_num"] = $badgeAddNum;
}
}