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,385 @@
|
|
|
1
|
+
import {NativeModules, PermissionsAndroid, Platform} from 'react-native';
|
|
2
|
+
import { BaseResponseModel } from './SMDataModels';
|
|
3
|
+
|
|
4
|
+
const {RNSmartMessage} = NativeModules;
|
|
5
|
+
|
|
6
|
+
const ANDROID = 'android';
|
|
7
|
+
const IOS = 'ios';
|
|
8
|
+
|
|
9
|
+
export default class SmartMessage {
|
|
10
|
+
|
|
11
|
+
//android only
|
|
12
|
+
static async checkNotificationPermission() {
|
|
13
|
+
|
|
14
|
+
if (Platform.OS === ANDROID) {
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
const granted = await PermissionsAndroid.check(
|
|
18
|
+
PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS,
|
|
19
|
+
);
|
|
20
|
+
return granted;
|
|
21
|
+
} catch (error) {
|
|
22
|
+
throw(error)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//android only
|
|
30
|
+
static async checkLocationPermission(){
|
|
31
|
+
try {
|
|
32
|
+
const coarseLocationPermission = await PermissionsAndroid.check(
|
|
33
|
+
PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION,
|
|
34
|
+
);
|
|
35
|
+
const fineLocationPermission = await PermissionsAndroid.check(
|
|
36
|
+
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
if(coarseLocationPermission || fineLocationPermission ){
|
|
40
|
+
console.log('Location permission is granted');
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
console.log('Location permission is not granted');
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
} catch (error) {
|
|
48
|
+
throw(error);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
static async getNotificationContent(contentUrl) {
|
|
54
|
+
|
|
55
|
+
try {
|
|
56
|
+
|
|
57
|
+
if(contentUrl == null){
|
|
58
|
+
throw("contentUrl cannot be null");
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
let response = await RNSmartMessage.getNotificationContent(contentUrl);
|
|
62
|
+
return JSON.parse(response);
|
|
63
|
+
|
|
64
|
+
} catch (error) {
|
|
65
|
+
throw(error);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
static async getToken() {
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
var token = await RNSmartMessage.getToken();
|
|
74
|
+
|
|
75
|
+
if(token != null)
|
|
76
|
+
return token;
|
|
77
|
+
else{
|
|
78
|
+
throw "token is not set yet";
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
} catch (error) {
|
|
82
|
+
throw(error);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
static async getUserInfo() {
|
|
88
|
+
|
|
89
|
+
try {
|
|
90
|
+
let response = await RNSmartMessage.getUserInfo();
|
|
91
|
+
return JSON.parse(response);
|
|
92
|
+
} catch (error) {
|
|
93
|
+
throw(error);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
static setUserInfo(userInfo) {
|
|
99
|
+
|
|
100
|
+
try {
|
|
101
|
+
if (userInfo == null) {
|
|
102
|
+
throw("userInfo cannot be null");
|
|
103
|
+
}
|
|
104
|
+
RNSmartMessage.setUserInfo(JSON.stringify(userInfo));
|
|
105
|
+
} catch (error) {
|
|
106
|
+
throw(error);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
static async setUserInfoWithPromise(userInfo) {
|
|
112
|
+
|
|
113
|
+
try {
|
|
114
|
+
|
|
115
|
+
if (userInfo == null) {
|
|
116
|
+
throw("userInfo cannot be null");
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
let response = await RNSmartMessage.setUserInfoWithPromise(JSON.stringify(userInfo));
|
|
120
|
+
return new BaseResponseModel.fromJson(response);
|
|
121
|
+
|
|
122
|
+
} catch (error) {
|
|
123
|
+
throw(error);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
static displayDialog(message) {
|
|
129
|
+
|
|
130
|
+
try {
|
|
131
|
+
|
|
132
|
+
if (message == null) {
|
|
133
|
+
throw('message cannot be null');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
RNSmartMessage.displayDialog(JSON.stringify(message));
|
|
137
|
+
} catch (error) {
|
|
138
|
+
throw(error);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
static async displayDialogWithPromise(message) {
|
|
144
|
+
|
|
145
|
+
try {
|
|
146
|
+
|
|
147
|
+
if (message == null) {
|
|
148
|
+
throw('message cannot be null');
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
console.log(JSON.stringify(message));
|
|
152
|
+
|
|
153
|
+
if (Platform.OS === IOS) {
|
|
154
|
+
RNSmartMessage.displayDialog(JSON.stringify(message));
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
let response = await RNSmartMessage.displayDialogWithPromise(JSON.stringify(message));
|
|
159
|
+
return JSON.parse(response);
|
|
160
|
+
} catch (error) {
|
|
161
|
+
throw(error);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
static saveConfig(){
|
|
167
|
+
|
|
168
|
+
try {
|
|
169
|
+
RNSmartMessage.saveConfig();
|
|
170
|
+
} catch (error) {
|
|
171
|
+
throw(error);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
static async saveConfigWithPromise(){
|
|
177
|
+
|
|
178
|
+
try {
|
|
179
|
+
let response = await RNSmartMessage.saveConfigWithPromise();
|
|
180
|
+
return response;
|
|
181
|
+
} catch (error) {
|
|
182
|
+
throw(error);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
static matchContactDevice(matchContactDeviceRequestModel){
|
|
188
|
+
|
|
189
|
+
try {
|
|
190
|
+
|
|
191
|
+
if (matchContactDeviceRequestModel == null){
|
|
192
|
+
throw("matchContactDeviceRequestBody cannot be null");
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
RNSmartMessage.matchContactDevice(JSON.stringify(matchContactDeviceRequestModel));
|
|
196
|
+
return;
|
|
197
|
+
} catch (error) {
|
|
198
|
+
throw(error);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
static async matchContactDeviceWithPromise(matchContactDeviceRequestModel){
|
|
204
|
+
|
|
205
|
+
try {
|
|
206
|
+
|
|
207
|
+
if (matchContactDeviceRequestModel == null){
|
|
208
|
+
throw("matchContactDeviceRequestBody cannot be null");
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
let response = await RNSmartMessage.matchContactDeviceWithPromise(
|
|
212
|
+
JSON.stringify(matchContactDeviceRequestModel)
|
|
213
|
+
);
|
|
214
|
+
|
|
215
|
+
return JSON.parse(response);
|
|
216
|
+
|
|
217
|
+
} catch (error) {
|
|
218
|
+
throw(error);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
static reportCustomEvent(eventIdentifier, uniqueId, parameters) {
|
|
224
|
+
|
|
225
|
+
try {
|
|
226
|
+
|
|
227
|
+
if(eventIdentifier == null || uniqueId == null || parameters == null){
|
|
228
|
+
throw("eventIdentifier, uniqueId or parameters cannot be null");
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
RNSmartMessage.reportCustomEvent(eventIdentifier, uniqueId, JSON.stringify(parameters));
|
|
232
|
+
} catch (error) {
|
|
233
|
+
throw(error);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
static async reportCustomEventWithPromise(eventIdentifier, uniqueId, parameters) {
|
|
238
|
+
|
|
239
|
+
try {
|
|
240
|
+
|
|
241
|
+
if(eventIdentifier == null || uniqueId == null || parameters == null){
|
|
242
|
+
throw("eventIdentifier, uniqueId or parameters cannot be null");
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
let response = await RNSmartMessage.reportCustomEventWithPromise(eventIdentifier, uniqueId, JSON.stringify(parameters));
|
|
246
|
+
return JSON.parse(response);
|
|
247
|
+
} catch (error) {
|
|
248
|
+
throw(error);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
static reportLoggedIn() {
|
|
253
|
+
|
|
254
|
+
try {
|
|
255
|
+
RNSmartMessage.reportLoggedIn();
|
|
256
|
+
} catch (error) {
|
|
257
|
+
throw(error);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
static async reportLoggedInWithPromise() {
|
|
262
|
+
|
|
263
|
+
try {
|
|
264
|
+
let response = await RNSmartMessage.reportLoggedInWithPromise();
|
|
265
|
+
return JSON.parse(response);
|
|
266
|
+
} catch (error) {
|
|
267
|
+
throw(error);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
static reportLoggedOut() {
|
|
272
|
+
|
|
273
|
+
try {
|
|
274
|
+
RNSmartMessage.reportLoggedOut();
|
|
275
|
+
} catch (error) {
|
|
276
|
+
throw(error);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
static async reportLoggedOutWithPromise() {
|
|
281
|
+
|
|
282
|
+
try {
|
|
283
|
+
|
|
284
|
+
let response = await RNSmartMessage.reportLoggedOutWithPromise();
|
|
285
|
+
return JSON.parse(response);
|
|
286
|
+
|
|
287
|
+
} catch (error) {
|
|
288
|
+
throw(error);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
static requestNotificationPermission() {
|
|
293
|
+
|
|
294
|
+
try {
|
|
295
|
+
RNSmartMessage.requestNotificationPermission();
|
|
296
|
+
} catch (error) {
|
|
297
|
+
throw(error);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
static async requestNotificationPermissionWithPromise() {
|
|
303
|
+
|
|
304
|
+
try {
|
|
305
|
+
let response = await RNSmartMessage.requestNotificationPermissionWithPromise();
|
|
306
|
+
return JSON.parse(response);
|
|
307
|
+
} catch (error) {
|
|
308
|
+
throw(error);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
static permissionUpdate(permissionType, isGranted) {
|
|
314
|
+
|
|
315
|
+
try {
|
|
316
|
+
|
|
317
|
+
if(permissionType == null || isGranted == null){
|
|
318
|
+
throw("permissionType or isGranted cannot be null");
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
RNSmartMessage.permissionUpdate(permissionType, isGranted);
|
|
322
|
+
} catch (error) {
|
|
323
|
+
throw(error);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
static async permissionUpdateWithPromise(permissionType, isGranted) {
|
|
328
|
+
|
|
329
|
+
try {
|
|
330
|
+
|
|
331
|
+
if(permissionType == null || isGranted == null){
|
|
332
|
+
throw("permissionType or isGranted cannot be null");
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
let response = await RNSmartMessage.permissionUpdateWithPromise(permissionType, isGranted);
|
|
336
|
+
return JSON.parse(response);
|
|
337
|
+
|
|
338
|
+
} catch (error) {
|
|
339
|
+
throw(error);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
static requestLocationPermission() {
|
|
345
|
+
|
|
346
|
+
try {
|
|
347
|
+
RNSmartMessage.requestLocationPermission();
|
|
348
|
+
} catch (error) {
|
|
349
|
+
throw(error);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
static async requestLocationPermissionWithPromise() {
|
|
355
|
+
|
|
356
|
+
try {
|
|
357
|
+
let response = await RNSmartMessage.requestLocationPermissionWithPromise();
|
|
358
|
+
return JSON.parse(response);
|
|
359
|
+
} catch (error) {
|
|
360
|
+
throw(error);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
static startLocationTracking() {
|
|
366
|
+
|
|
367
|
+
try {
|
|
368
|
+
return RNSmartMessage.startLocationTracking();
|
|
369
|
+
} catch (error) {
|
|
370
|
+
throw(error);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
static stopLocationTracking() {
|
|
375
|
+
|
|
376
|
+
try {
|
|
377
|
+
return RNSmartMessage.stopLocationTracking();
|
|
378
|
+
} catch (error) {
|
|
379
|
+
throw(error);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
declare class SmartMessage {
|
|
2
|
+
|
|
3
|
+
static async getToken(): Promise<string | null>;
|
|
4
|
+
static async getUserInfo(): Promise<UserInfoModel>;
|
|
5
|
+
static async getMessageList(messageListRequestBody: MessageListRequestBody): Promise<MessageListResponseModel[]>;
|
|
6
|
+
static async getNotificationContent(contentUrl: String): Promise<BaseNotificationModel>;
|
|
7
|
+
|
|
8
|
+
static async setUserInfoWithPromise(userInfo: UserInfoModel): Promise<string>;
|
|
9
|
+
static setUserInfo(userInfo: UserInfoModel): void;
|
|
10
|
+
|
|
11
|
+
static displayDialog(message: BaseNotificationModel): void;
|
|
12
|
+
static displayDialogWithPromise(message: BaseNotificationModel): Promise<boolean>;
|
|
13
|
+
static async matchContactDevice(data: MatchContactDeviceRequestBody): void;
|
|
14
|
+
static async matchContactDeviceWithPromise(data: MatchContactDeviceRequestBody):Promise<BaseResponseModel>;
|
|
15
|
+
static saveConfig() : void;
|
|
16
|
+
static async saveConfigWithPromise() :Promise <BaseResponseModel>;
|
|
17
|
+
|
|
18
|
+
static saveNotificationToDB(notificationModel: BaseNotificationModel,isSeen : boolean) : void;
|
|
19
|
+
static async getNotificationListFromDB():Promise<MessageListResponseModel[]>
|
|
20
|
+
static updateNotificationAsSeen(notificationId : string) : void;
|
|
21
|
+
static updateNotificationContent(notificationId : string, notificationModel : BaseNotificationModel) : void;
|
|
22
|
+
|
|
23
|
+
static reportCustomEvent(eventIdentifier : string, uniqueId : string, parameters : string) : void;
|
|
24
|
+
static reportCustomEventWithPromse(eventIdentifier : string, uniqueId : string, parameters : string) : Promise<BaseResponseModel>;
|
|
25
|
+
|
|
26
|
+
static reportLoggedIn(): void;
|
|
27
|
+
static async reportLoggedInWithPromise(): Promise<BaseResponseModel>;
|
|
28
|
+
static reportLoggedOut(): void;
|
|
29
|
+
static async reportLoggedOutWithPromise(): Promise<BaseResponseModel>;
|
|
30
|
+
|
|
31
|
+
static permissionUpdate(permissionType: PERMISSION_TYPE,isGranted: boolean): void;
|
|
32
|
+
static async permissionUpdateWithPromise( permissionType: PERMISSION_TYPE,isGranted: boolean): Promise<BaseResponseModel>;
|
|
33
|
+
static requestNotificationPermission(): void;
|
|
34
|
+
static async requestNotificationPermissionWithPromise(): Promise<boolean>;
|
|
35
|
+
|
|
36
|
+
static requestLocationPermission(): void;
|
|
37
|
+
static async requestLocationPermissionWithPromise(): Promise<boolean>;
|
|
38
|
+
static startLocationTracking(): void;
|
|
39
|
+
static stopLocationTracking(): void;
|
|
40
|
+
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare class BaseResponseModel {
|
|
44
|
+
httpStatus : number;
|
|
45
|
+
responseCode : number;
|
|
46
|
+
explanation : string;
|
|
47
|
+
|
|
48
|
+
constructor(httpStatusCode : number, responseCode : number, explanation : string ) : BaseResponseModel;
|
|
49
|
+
getExplanation() : String ;
|
|
50
|
+
getResponseCode() : number;
|
|
51
|
+
getHttpStatusCode() : number;
|
|
52
|
+
|
|
53
|
+
static fromJson(json: string) : BaseResponseModel;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare class MatchContactDeviceRequestBody {
|
|
57
|
+
constructor(externalId : string, targetAddress : MatchContactDeviceTargetAddress[]) : MatchContactDeviceRequestBody;
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
declare class MatchContactDeviceTargetAddress {
|
|
62
|
+
constructor(key : string, value : string) : MatchContactDeviceTargetAddress
|
|
63
|
+
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
declare class MessageListRequestModel {
|
|
67
|
+
|
|
68
|
+
constructor (index : number, size : number, startDate : Date, endDate : Date, status : string[], pushType: string[], expiredPush: boolean) : MessageListRequestModel;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
declare class MessageListResponseModel {
|
|
72
|
+
|
|
73
|
+
data: MessageEntity[];
|
|
74
|
+
count: number;
|
|
75
|
+
constructor(data: MessageEntity[], count: number) : MessageListResponseModel;
|
|
76
|
+
|
|
77
|
+
getData() : MessageEntity[]
|
|
78
|
+
|
|
79
|
+
getCount() : number;
|
|
80
|
+
|
|
81
|
+
static fromJson(json: string) {
|
|
82
|
+
var obj = JSON.parse(json);
|
|
83
|
+
return new MessageListResponseModel(obj.data, obj.count);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
declare class MessageEntity {
|
|
89
|
+
|
|
90
|
+
id: String;
|
|
91
|
+
type: PushType;
|
|
92
|
+
tags: String;
|
|
93
|
+
seen: Boolean;
|
|
94
|
+
sentDate: String;
|
|
95
|
+
thumbnail: String;
|
|
96
|
+
title: String;
|
|
97
|
+
messageText: String;
|
|
98
|
+
contentUrl: String;
|
|
99
|
+
isDataDownloaded: Boolean;
|
|
100
|
+
notificationJson: String;
|
|
101
|
+
|
|
102
|
+
constructor(id: String, type: PushType, tags: String, seen: Boolean, sentDate: String, thumbnail: String, title: String, messageText: String, contentUrl: String, isDataDownloaded: Boolean, notificationJson: String) : MessageEntity;
|
|
103
|
+
|
|
104
|
+
static fromJson(json: string) : MessageEntity
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
declare class UserInfoModel {
|
|
109
|
+
|
|
110
|
+
constructor(id : String, name : String, surname : String, email : String, mobile : String, birthdate : Date, gender : String, username : String, rcvNot: any, tags: any, lang: any) : UserInfoModel;
|
|
111
|
+
static fromJson(json: string) : UserInfoModel;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export {SmartMessage, BaseResponseModel, UserInfoModel, MessageListRequestModel, MessageListResponseModel , MessageEntity} ;
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
export interface Button {
|
|
118
|
+
label: string;
|
|
119
|
+
link: string;
|
|
120
|
+
color: string;
|
|
121
|
+
textColor: string;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface Slide {
|
|
125
|
+
title: string;
|
|
126
|
+
message: string;
|
|
127
|
+
imageUrl: string;
|
|
128
|
+
buttons: Button[];
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export const PUSH_TYPE = {
|
|
132
|
+
BASIC: '0',
|
|
133
|
+
IMAGE: '1',
|
|
134
|
+
HTML_PUSH: '2',
|
|
135
|
+
GIF: '3',
|
|
136
|
+
VIDEO: '4',
|
|
137
|
+
AUDIO: '5',
|
|
138
|
+
BASIC_CAROUSEL: '6',
|
|
139
|
+
ROTARY_CAROUSEL: '7',
|
|
140
|
+
COVERFLOW_CAROUSEL: '8',
|
|
141
|
+
SLIDER: '9',
|
|
142
|
+
SMALL_DIALOG: '10',
|
|
143
|
+
MEDIUM_DIALOG: '11',
|
|
144
|
+
FULLSCREEN_DIALOG: '12',
|
|
145
|
+
INTERACTIVE_DIALOG: '13',
|
|
146
|
+
HTML_DIALOG: '14'
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export const PERMISSION_TYPE = {
|
|
150
|
+
NOTIFICATION: 'notification',
|
|
151
|
+
LOCATION: 'location',
|
|
152
|
+
BACKGROUND_LOCATION: 'backgroundLocation',
|
|
153
|
+
APPROXIMATE_LOCATION: 'approx',
|
|
154
|
+
PRECISE_LOCATION: 'precise',
|
|
155
|
+
BLUETOOTH: 'bluetooth',
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export type PushType = typeof PUSH_TYPE;
|
|
159
|
+
|
|
160
|
+
export type PermissionType = typeof PERMISSION_TYPE;
|
|
161
|
+
|
|
162
|
+
export interface BaseNotificationModel {
|
|
163
|
+
type: PushType;
|
|
164
|
+
id: string;
|
|
165
|
+
thumb: string;
|
|
166
|
+
sound: string;
|
|
167
|
+
title: string;
|
|
168
|
+
message: string;
|
|
169
|
+
link: string;
|
|
170
|
+
buttons: Button[];
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export type BaseSliderNotificationModel = BaseNotificationModel & {
|
|
174
|
+
slides: Slide[];
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export type BasicNotificationModel = BaseNotificationModel & {};
|
|
178
|
+
|
|
179
|
+
export type ImageNotificationModel = BaseNotificationModel & {
|
|
180
|
+
media_url: string;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export type HTMLNotificationModel = BaseNotificationModel & {
|
|
184
|
+
media_url: string;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
export type GifNotificationModel = BaseNotificationModel & {
|
|
188
|
+
cover_url: string;
|
|
189
|
+
media_url: string;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
export type VideoNotificationModel = BaseNotificationModel & {
|
|
193
|
+
cover_url: string;
|
|
194
|
+
media_url: string;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export type AudioNotificationModel = BaseNotificationModel & {
|
|
198
|
+
media_url: string;
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
export type BasicCarouselNotificationModel = BaseSliderNotificationModel & {};
|
|
202
|
+
export type RotaryCarouselNotificationModel = BaseSliderNotificationModel & {};
|
|
203
|
+
export type CoverflowCarouselNotificationModel = BaseSliderNotificationModel & {};
|
|
204
|
+
export type SliderNotificationModel = BaseSliderNotificationModel & {};
|
|
205
|
+
|
|
206
|
+
export type SmallDialogModel = BaseNotificationModel & {};
|
|
207
|
+
export type MediumDialogModel = BaseNotificationModel & {
|
|
208
|
+
image: string;
|
|
209
|
+
};
|
|
210
|
+
export type FullscreenDialogModel = BaseNotificationModel & {
|
|
211
|
+
image: string;
|
|
212
|
+
};
|
|
213
|
+
export type InteractiveDialogModel = BaseNotificationModel & {
|
|
214
|
+
image: string;
|
|
215
|
+
};
|
|
216
|
+
export type HTMLDialogModel = BaseNotificationModel & {
|
|
217
|
+
media_url: string;
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
export interface MessageListRequestModel {
|
|
221
|
+
index: number;
|
|
222
|
+
size: number;
|
|
223
|
+
startDate: Date;
|
|
224
|
+
endDate: Date;
|
|
225
|
+
customerNo: string;
|
|
226
|
+
externalId: string;
|
|
227
|
+
status: string[];
|
|
228
|
+
pushType: string[];
|
|
229
|
+
expiredPush: boolean;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export interface Media {
|
|
233
|
+
mediaUrl: string;
|
|
234
|
+
|
|
235
|
+
iconUrl: string;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
|