smartmessage-react-native 2.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RNSmartMessage.podspec +30 -0
- package/android/build.gradle +65 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/tr/com/odc/RNSmartMessage/RNSmartMessageModule.java +774 -0
- package/android/src/main/java/tr/com/odc/RNSmartMessage/RNSmartMessagePackage.java +29 -0
- package/ios/RNSmartMessage-Bridging-Header.h +1 -0
- package/ios/RNSmartMessage.h +25 -0
- package/ios/RNSmartMessage.m +138 -0
- package/ios/RNSmartMessage.swift +660 -0
- package/package.json +38 -0
- package/readme.md +494 -0
- package/src/SMDataModels.js +457 -0
- package/src/SmartMessage.js +385 -0
- package/src/index.d.ts +238 -0
- package/src/index.js +8 -0
- package/src/types.d.ts +451 -0
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
export const PUSH_TYPE = {
|
|
2
|
+
BASIC: '0',
|
|
3
|
+
IMAGE: '1',
|
|
4
|
+
HTML_PUSH: '2',
|
|
5
|
+
GIF: '3',
|
|
6
|
+
VIDEO: '4',
|
|
7
|
+
AUDIO: '5',
|
|
8
|
+
BASIC_CAROUSEL: '6',
|
|
9
|
+
ROTARY_CAROUSEL: '7',
|
|
10
|
+
COVERFLOW_CAROUSEL: '8',
|
|
11
|
+
SLIDER: '9',
|
|
12
|
+
SMALL_DIALOG: '10',
|
|
13
|
+
MEDIUM_DIALOG: '11',
|
|
14
|
+
FULLSCREEN_DIALOG: '12',
|
|
15
|
+
INTERACTIVE_DIALOG: '13',
|
|
16
|
+
HTML_DIALOG: '14'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const PERMISSION_TYPE = {
|
|
20
|
+
NOTIFICATION: 'notification',
|
|
21
|
+
LOCATION: 'location',
|
|
22
|
+
BACKGROUND_LOCATION: 'backgroundLocation',
|
|
23
|
+
APPROXIMATE_LOCATION: 'approx',
|
|
24
|
+
PRECISE_LOCATION: 'precise'
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const DEEPLINK_TYPE = {
|
|
28
|
+
NONE : 0,
|
|
29
|
+
WEB_LINK : 1,
|
|
30
|
+
APP_LINK : 2,
|
|
31
|
+
API_CALL : 3
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export class BaseResponseModel {
|
|
35
|
+
|
|
36
|
+
constructor(httpStatusCode, responseCode , explanation)
|
|
37
|
+
{
|
|
38
|
+
this.httpStatusCode = httpStatusCode; this.responseCode = responseCode; this.explanation = explanation;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
getExplanation(){
|
|
42
|
+
return this.explanation;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
getResponseCode(){
|
|
46
|
+
return this.responseCode;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
getHttpStatusCode(){
|
|
50
|
+
return this.httpStatusCode;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
static fromJson(json) {
|
|
54
|
+
var obj = JSON.parse(json);
|
|
55
|
+
return new BaseResponseModel(obj.httpStatusCode, obj.responseCode, obj.explanation);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
static fromObj(obj) {
|
|
59
|
+
return new BaseResponseModel(obj.httpStatusCode, obj.responseCode, obj.explanation);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export class CreateCustomEventRequestModel {
|
|
65
|
+
|
|
66
|
+
constructor(eventIdentifier, uniqueId,parameters){
|
|
67
|
+
this.eventIdentifier = eventIdentifier;
|
|
68
|
+
this.uniqueId = uniqueId;
|
|
69
|
+
this.parameters = parameters;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export class MatchContactDeviceRequestModel {
|
|
75
|
+
|
|
76
|
+
constructor(externalId, targetAddress){
|
|
77
|
+
this.externalId = externalId;
|
|
78
|
+
this.targetAddress = targetAddress;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export class MatchContactDeviceTargetAddress {
|
|
84
|
+
|
|
85
|
+
constructor(key, value){
|
|
86
|
+
this.key = key;
|
|
87
|
+
this.value = value;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export class UserInfoModel {
|
|
93
|
+
|
|
94
|
+
constructor(id, name, surname, email, mobile, birthdate, gender, username, rcvNot, tags, lang){
|
|
95
|
+
this.id = id; //string
|
|
96
|
+
this.name = name; //string
|
|
97
|
+
this.surname = surname; //string
|
|
98
|
+
this.email = email; //string
|
|
99
|
+
this.mobile = mobile; //string
|
|
100
|
+
this.birthdate = birthdate; //Date
|
|
101
|
+
this.gender = gender; //string
|
|
102
|
+
this.username = username; //string
|
|
103
|
+
this.rcvNot = rcvNot; //bool
|
|
104
|
+
this.tags = tags; //string
|
|
105
|
+
this.lang = lang; //string
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
static fromJson(json) {
|
|
109
|
+
var obj = JSON.parse(json);
|
|
110
|
+
return new UserInfoModel(obj.id, obj.name, obj.surname, obj.email , obj.mobile , obj.birthdate , obj.gender , obj.username , obj.rcvNot , obj.tags , obj.lang);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
static fromObj(obj) {
|
|
114
|
+
return new UserInfoModel(obj.id, obj.name, obj.surname, obj.email , obj.mobile , obj.birthdate , obj.gender , obj.username , obj.rcvNot , obj.tags , obj.lang);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export class SMPButton {
|
|
120
|
+
|
|
121
|
+
constructor(label, link, link_Id, deepLinkType, color, textColor )
|
|
122
|
+
{
|
|
123
|
+
this.label = label; this.link = link; this.link_Id = link_Id; this.deepLinkType = deepLinkType; this.color = color; this.textColor = textColor;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
static fromJson(json) {
|
|
127
|
+
var obj = JSON.parse(json);
|
|
128
|
+
return new SMPButton(obj.label, obj.link, obj.link_Id, obj.deepLinkType, obj.color, obj.textColor);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export class SlideModel {
|
|
134
|
+
|
|
135
|
+
constructor(title, message, imageUrl, buttons)
|
|
136
|
+
{
|
|
137
|
+
this.title = title; this.message = message; this.imageUrl = imageUrl; this.buttons = buttons;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
static fromJson(json) {
|
|
141
|
+
var obj = JSON.parse(json);
|
|
142
|
+
return new Slide(obj.title, obj.message, obj.imageUrl, obj.buttons);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export class BaseNotificationModel {
|
|
148
|
+
|
|
149
|
+
constructor(type, tags, id, thumb, sound, title, message, link, linkId, buttons )
|
|
150
|
+
{
|
|
151
|
+
this.type = type; this.tags = tags; this.id = id; this.thumb = thumb; this.sound = sound; this.title = title; this.message = message;this.link = link; this.linkId = linkId; this.buttons = buttons;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
static fromJson(json) {
|
|
155
|
+
var obj = JSON.parse(json);
|
|
156
|
+
return new BaseNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null , obj.buttons || null);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
static fromObj(obj) {
|
|
160
|
+
return new BaseNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
export class BasicNotificationModel extends BaseNotificationModel {
|
|
167
|
+
constructor(type, tags, id, thumb, sound, title, message, link, linkId, buttons ) {
|
|
168
|
+
super(type, tags, id, thumb, sound, title, message, link, linkId, buttons);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
static fromJson(json){
|
|
172
|
+
var obj = JSON.parse(json);
|
|
173
|
+
return new BasicNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
static fromObj(obj){
|
|
177
|
+
return new BasicNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export class BaseRichNotificationModel extends BaseNotificationModel {
|
|
182
|
+
|
|
183
|
+
constructor(type, tags, id, thumb, sound, title, message, link, linkId, buttons, mediaUrl ) {
|
|
184
|
+
super(type, tags, id, thumb, sound, title, message, link, linkId, buttons);
|
|
185
|
+
this.mediaUrl = mediaUrl;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
static fromJson(json){
|
|
189
|
+
var obj = JSON.parse(json);
|
|
190
|
+
return new BaseRichNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.mediaUrl);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
static fromObj(obj){
|
|
194
|
+
return new BaseRichNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.mediaUrl);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export class ImageNotificationModel extends BaseRichNotificationModel {
|
|
199
|
+
|
|
200
|
+
constructor(type, tags, id, thumb, sound, title, message, link, linkId, buttons, mediaUrl ) {
|
|
201
|
+
super(type, tags, id, thumb, sound, title, message, link, buttons, linkId, mediaUrl);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
static fromJson(json){
|
|
205
|
+
var obj = JSON.parse(json);
|
|
206
|
+
return new ImageNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.mediaUrl);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
static fromObj(obj){
|
|
210
|
+
return new ImageNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.mediaUrl);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export class GifNotificationModel extends BaseRichNotificationModel {
|
|
216
|
+
|
|
217
|
+
constructor(type, tags, id, thumb, sound, title, message, link, linkId, buttons, mediaUrl ) {
|
|
218
|
+
super(type, tags, id, thumb, sound, title, message, link, buttons, linkId, mediaUrl);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
static fromJson(json){
|
|
222
|
+
var obj = JSON.parse(json);
|
|
223
|
+
return new GifNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.mediaUrl);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
static fromObj(obj){
|
|
227
|
+
return new GifNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.mediaUrl);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export class AudioNotificationModel extends BaseRichNotificationModel {
|
|
233
|
+
|
|
234
|
+
constructor(type, tags, id, thumb, sound, title, message, link, linkId, buttons, mediaUrl) {
|
|
235
|
+
super(type, tags, id, thumb, sound, title, message, link, linkId, buttons, mediaUrl);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
static fromJson(json){
|
|
239
|
+
var obj = JSON.parse(json);
|
|
240
|
+
return new AudioNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.mediaUrl);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
static fromObj(obj){
|
|
244
|
+
return new AudioNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.mediaUrl);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export class VideoNotificationModel extends BaseRichNotificationModel {
|
|
250
|
+
|
|
251
|
+
constructor(type, tags, id, thumb, sound, title, message, link, linkId, buttons, mediaUrl, coverUrl ) {
|
|
252
|
+
super(type, tags, id, thumb, sound, title, message, link, linkId, buttons, mediaUrl);
|
|
253
|
+
this.coverUrl = coverUrl;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
static fromJson(json){
|
|
257
|
+
var obj = JSON.parse(json);
|
|
258
|
+
return new VideoNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.mediaUrl, obj.coverUrl || null);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
static fromObj(obj){
|
|
262
|
+
return new VideoNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.mediaUrl, obj.coverUrl || null);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export class HTMLNotificationModel extends BaseRichNotificationModel {
|
|
268
|
+
|
|
269
|
+
constructor(type, tags, id, thumb, sound, title, message, link, linkId, buttons, mediaUrl ) {
|
|
270
|
+
super(type, tags, id, thumb, sound, title, message, link, linkId,buttons, mediaUrl);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
static fromJson(json){
|
|
274
|
+
var obj = JSON.parse(json);
|
|
275
|
+
return new HTMLNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.mediaUrl);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
static fromObj(obj){
|
|
279
|
+
return new HTMLNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.mediaUrl);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
export class BaseSliderNotificationModel extends BaseNotificationModel {
|
|
285
|
+
|
|
286
|
+
constructor(type, tags, id, thumb, sound, title, message, link, linkId, buttons ,slides){
|
|
287
|
+
super(type, tags, id, thumb, sound, title, message, link, linkId, buttons);
|
|
288
|
+
this.slides = slides;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
static fromJson(json) {
|
|
292
|
+
var obj = JSON.parse(json);
|
|
293
|
+
return new BaseSliderNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.slides);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
static fromObj(obj) {
|
|
297
|
+
return new BaseSliderNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.slides);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export class BasicCarouselNotificationModel extends BaseSliderNotificationModel {
|
|
303
|
+
|
|
304
|
+
constructor(type, tags, id, thumb, sound, title, message, link, linkId, buttons ,slides){
|
|
305
|
+
super(type, tags, id, thumb, sound, title, message, link, linkId, buttons, slides);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
static fromJson(json) {
|
|
309
|
+
var obj = JSON.parse(json);
|
|
310
|
+
return new BasicCarouselNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.slides);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
static fromObj(obj) {
|
|
314
|
+
return new BasicCarouselNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.slides);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export class RotaryCarouselNotificationModel extends BaseSliderNotificationModel {
|
|
320
|
+
|
|
321
|
+
constructor(type, tags, id, thumb, sound, title, message, link, linkId, buttons ,slides){
|
|
322
|
+
super(type, tags, id, thumb, sound, title, message, link, linkId, buttons, slides);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
static fromJson(json) {
|
|
326
|
+
var obj = JSON.parse(json);
|
|
327
|
+
return new RotaryCarouselNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.slides);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
static fromObj(obj) {
|
|
331
|
+
return new RotaryCarouselNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.slides);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export class CoverflowCarouselNotificationModel extends BaseSliderNotificationModel {
|
|
337
|
+
|
|
338
|
+
constructor(type, tags, id, thumb, sound, title, message, link, linkId, buttons ,slides){
|
|
339
|
+
super(type, tags, id, thumb, sound, title, message, link, linkId, buttons, slides);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
static fromJson(json) {
|
|
343
|
+
var obj = JSON.parse(json);
|
|
344
|
+
return new CoverflowCarouselNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.slides);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
static fromObj(obj) {
|
|
348
|
+
return new CoverflowCarouselNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.slides);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
export class SliderNotificationModel extends BaseSliderNotificationModel {
|
|
354
|
+
|
|
355
|
+
constructor(type, tags, id, thumb, sound, title, message, link, linkId, buttons ,slides){
|
|
356
|
+
super(type, tags, id, thumb, sound, title, message, link, linkId, buttons, slides);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
static fromJson(json) {
|
|
360
|
+
var obj = JSON.parse(json);
|
|
361
|
+
return new SliderNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.slides);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
static fromObj(obj) {
|
|
365
|
+
return new SliderNotificationModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.slides);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
export class SmallDialogModel extends BaseNotificationModel {
|
|
371
|
+
|
|
372
|
+
constructor(type, tags, id, thumb, sound, title, message, link, linkId, buttons ) {
|
|
373
|
+
super(type, tags, id, thumb, sound, title, message, link, linkId, buttons);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
static fromJson(json){
|
|
377
|
+
var obj = JSON.parse(json);
|
|
378
|
+
return new SmallDialogModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
static fromObj(obj){
|
|
382
|
+
return new SmallDialogModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export class MediumDialogModel extends BaseNotificationModel {
|
|
388
|
+
|
|
389
|
+
constructor(type, tags, id, thumb, sound, title, message, link, linkId, buttons ) {
|
|
390
|
+
super(type, tags, id, thumb, sound, title, message, link, linkId, buttons);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
static fromJson(json){
|
|
394
|
+
var obj = JSON.parse(json);
|
|
395
|
+
return new MediumDialogModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
static fromObj(obj){
|
|
399
|
+
return new MediumDialogModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
export class FullscreenDialogModel extends BaseNotificationModel {
|
|
405
|
+
|
|
406
|
+
constructor(type, tags, id, thumb, sound, title, message, link, linkId, buttons ) {
|
|
407
|
+
super(type, tags, id, thumb, sound, title, message, link, linkId, buttons);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
static fromJson(json){
|
|
411
|
+
var obj = JSON.parse(json);
|
|
412
|
+
return new FullscreenDialogModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
static fromObj(obj){
|
|
416
|
+
return new FullscreenDialogModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
export class InteractiveDialogModel extends BaseNotificationModel {
|
|
422
|
+
|
|
423
|
+
constructor(type, tags, id, thumb, sound, title, message, link, linkId, buttons ) {
|
|
424
|
+
super(type, tags, id, thumb, sound, title, message, link, linkId, buttons);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
static fromJson(json){
|
|
428
|
+
var obj = JSON.parse(json);
|
|
429
|
+
return new InteractiveDialogModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
static fromObj(obj){
|
|
433
|
+
return new InteractiveDialogModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
export class HTMLDialogModel extends BaseRichNotificationModel {
|
|
439
|
+
|
|
440
|
+
constructor(type, tags, id, thumb, sound, title, message, link, linkId, buttons, mediaUrl) {
|
|
441
|
+
super(type, tags, id, thumb, sound, title, message, link, linkId, buttons, mediaUrl);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
static fromJson(json){
|
|
445
|
+
var obj = JSON.parse(json);
|
|
446
|
+
return new HTMLDialogModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.mediaUrl);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
static fromObj(obj){
|
|
450
|
+
try {
|
|
451
|
+
return new HTMLDialogModel(obj.type, obj.tags || null, obj.id, obj.thumb || null, obj.sound || "default", obj.title || "", obj.message || "", obj.link || null, obj.linkId || null, obj.buttons || null, obj.mediaUrl);
|
|
452
|
+
} catch (error) {
|
|
453
|
+
throw(error);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
}
|