GTAlert.php
4.0 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
<?php
class GTAlert extends GTApiRequest
{
/**
* 通知消息标题
*/
private $title;
/**
* 通知消息内容
*/
private $body;
/**
* (用于多语言支持)指定执行按钮所使用的Localizable.strings
*/
private $actionLocKey;
/**
* (用于多语言支持)指定Localizable.strings文件中相应的key
*/
private $locKey;
/**
* 如果loc-key中使用了占位符,则在loc-args中指定各参数
*/
private $locArgs;
/**
* 指定启动界面图片名
*/
private $launchImage;
/**
* (用于多语言支持)对于标题指定执行按钮所使用的Localizable.strings,仅支持iOS8.2以上版本
*/
private $titleLocKey;
/**
* 对于标题,如果loc-key中使用的占位符,则在loc-args中指定各参数,仅支持iOS8.2以上版本
*/
private $titleLocArgs;
/**
* 通知子标题,仅支持iOS8.2以上版本
*/
private $subtitle;
/**
* 当前本地化文件中的子标题字符串的关键字,仅支持iOS8.2以上版本
*/
private $subtitleLocKey;
/**
* 当前本地化子标题内容中需要置换的变量参数 ,仅支持iOS8.2以上版本
*/
private $subtitleLocArgs;
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 getActionLocKey()
{
return $this->actionLocKey;
}
public function setActionLocKey($actionLocKey)
{
$this->actionLocKey = $actionLocKey;
$this->apiParam["action-loc-key"] = $actionLocKey;
}
public function getLocKey()
{
return $this->locKey;
}
public function setLocKey($locKey)
{
$this->locKey = $locKey;
$this->apiParam["loc-key"] = $locKey;
}
public function getLocArgs()
{
return $this->locArgs;
}
public function setLocArgs($locArgs)
{
$this->locArgs = $locArgs;
}
public function getLaunchImage()
{
return $this->launchImage;
}
public function setLaunchImage($launchImage)
{
$this->launchImage = $launchImage;
$this->apiParam["launch-image"] = $launchImage;
}
public function getTitleLocKey()
{
return $this->titleLocKey;
}
public function setTitleLocKey($titleLocKey)
{
$this->titleLocKey = $titleLocKey;
$this->apiParam["title-loc-key"] = $titleLocKey;
}
public function getTitleLocArgs()
{
return $this->titleLocArgs;
}
public function setTitleLocArgs($titleLocArgs)
{
$this->titleLocArgs = $titleLocArgs;
}
public function getSubtitle()
{
return $this->subtitle;
}
public function setSubtitle($subtitle)
{
$this->subtitle = $subtitle;
$this->apiParam["subtitle"] = $subtitle;
}
public function getSubtitleLocKey()
{
return $this->subtitleLocKey;
}
public function setSubtitleLocKey($subtitleLocKey)
{
$this->subtitleLocKey = $subtitleLocKey;
$this->apiParam["subtitle-loc-key"] = $subtitleLocKey;
}
public function getSubtitleLocArgs()
{
return $this->subtitleLocArgs;
}
public function setSubtitleLocArgs($subtitleLocArgs)
{
$this->subtitleLocArgs = $subtitleLocArgs;
}
public function getApiParam()
{
if ($this->subtitleLocArgs != null){
$this->apiParam["subtitle-loc-args"] = $this->subtitleLocArgs;
}
if ($this->titleLocArgs != null){
$this->apiParam["title-loc-args"] = $this->titleLocArgs;
}
if ($this->locArgs != null){
$this->apiParam["loc-args"] = $this->locArgs;
}
return $this->apiParam;
}
}