-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.d.ts
501 lines (457 loc) · 12.4 KB
/
index.d.ts
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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
declare module 'blueshift-react-native' {
/**
* Initialise the plugin components when React Native is ready and loaded.
*
* Usage -
* Blueshift.init();
*/
function init(): void;
/**
* Add event listener for a event name to listen to events fired by Blueshift SDK
*
* Usage -
* Blueshift.addEventListener("PushNotificationClickedEvent", this.handlePush);
*
* @param {string} eventName Name of event to listen to.
* @param {function} callback callback function to handle the event
*
*/
function addEventListener(eventName : string, callback : any): void;
/**
* Remove the event listener.
*
* Usage -
* Blueshift.removeEventListener("PushNotificationClickedEvent");
*
* @param {string} eventName Name of event remove the listener.
*
*/
function removeEventListener(eventName : string): void;
/**
* Registers a page for showing in-app message.
*
* Usage -
* Blueshift.registerForInAppMessage("IndexScreen");
*
* @param {string} screenName Name of the screen.
*
*/
function registerForInAppMessage(screenName : string): void;
/**
* Get registered screen name for in-app messages.
*
* Usage -
* Blueshift.getRegisteredForInAppScreenName(screenName = {
* console.log("registered screen name - " + screenName);
* });
*
*/
function getRegisteredForInAppScreenName(callback : function): void;
/**
* Unregisters a page from showing in-app message.
*
* Usage -
* Blueshift.unregisterForInAppMessage();
*/
function unregisterForInAppMessage(): void;
/**
* Fetches in-app messages from the Blueshift API and provides them in the callbacks.
*
*
* Usage -
* Blueshift.fetchInAppNotification();
*/
function fetchInAppNotification(): void;
/**
* Display in-app message if the current page is registered for in-app messages.
*
* Usage -
* Blueshift.displayInAppNotification();
*/
function displayInAppNotification(): void;
/**
* Sends an identify event with the details available.
*
* Usage -
* Blueshift.Blueshift.identifyWithDetails({})
*
* @param {object} details Additional params (if any)
*
*/
function identifyWithDetails(details : any): void;
/**
* Send any custom event to Blueshift.
*
* Usage -
* Blueshift.trackCustomEvent("CustomEvent",{},false);
*
* @param {string} eventName Name of the custom event.
* @param {object} details Additional params (if any).
* @param {boolean} isBatch Tells if this event can be batched or not.
*
*/
function trackCustomEvent(eventName : string, details : any, isBatch : boolean): void;
/**
* Track screen view using Blueshift.
*
* Usage -
* Blueshift.trackScreenView("IndexScreen",{},false);
*
* @param {string} screenName Name of the screen to track.
* @param {object} details Additional params (if any).
* @param {boolean} isBatch Tells if this event can be batched or not.
*
*/
function trackScreenView(screenName : string, details : any, isBatch : boolean): void;
/**
* Save email in the SDK.
*
* Usage -
* Blueshift.setUserInfoEmailId("[email protected]");
*
* @param {string} emailId email of the customer.
*
*/
function setUserInfoEmailId(emailId : string): void;
/**
* Save customerId in the SDK.
*
* Usage -
* Blueshift.setUserInfoCustomerId("cust123456");
*
* @param {string} customerId customerId of the customer.
*
*/
function setUserInfoCustomerId(customerId : string): void;
/**
* Save firstname in the SDK.
*
* Usage -
* Blueshift.setUserInfoFirstName("John");
*
* @param {string} firstname firstname of the customer.
*
*/
function setUserInfoFirstName(firstname : string): void;
/**
* Save lastname in the SDK.
*
* Usage -
* Blueshift.setUserInfoLastName("Cartor");
*
* @param {string} lastname lastname of the customer.
*
*/
function setUserInfoLastName(lastname : string): void;
/**
* Save additional user info in the SDK.
*
* Usage -
* Blueshift.setUserInfoExtras({"profession":"software engineer", "usertype":"premium"});
*
* @param {object} extras additional user info.
*
*/
function setUserInfoExtras(extras : any): void;
/**
* Remove all the saved user info from the SDK.
*
* Usage -
* Blueshift.removeUserInfo();
*/
function removeUserInfo(): void;
/**
* Enable/disable SDK's event tracking.
*
* Usage -
* Blueshift.setEnableTracking(true);
*
* @param {boolean} enabled When true, tracking is enabled. When false, disabled.
*
*/
function setEnableTracking(enabled : boolean): void;
/**
* Opt-in or opt-out of push notifications sent from Blueshift.
*
* Usage -
* Blueshift.setEnablePush(true);
*
* @param {boolean} isEnabled When true, opt-in else opt-out.
*
*/
function setEnablePush(isEnabled : boolean): void;
/**
* Opt-in or opt-out of in-app notifications sent from Blueshift.
*
* Usage -
* Blueshift.setEnableInApp(true);
*
* @param {boolean} isEnabled When true, opt-in else opt-out.
*
*/
function setEnableInApp(isEnabled : boolean): void;
/**
* Set IDFA of the device in the Blueshift SDK.
* Note - This is only applicable for the iOS devices.
*
* Usage -
* Blueshift.setIDFA("EA7583CD-A667-48BC-B806-42ECB2B48606");
*
* @param {string} IDFAString IDFA value.
*
*/
function setIDFA(IDFAString : string): void;
/**
* Register for remote notifications using SDK. Calling this method will show push permission dialogue to the user.
* Note - This is only applicable for the iOS devices.
*
* Usage -
* Blueshift.registerForRemoteNotification();
*/
function registerForRemoteNotification(): void;
/**
* Set current location of the device in the Blueshift SDK.
* Note - This is only applicable for the iOS devices.
*
* Usage -
* Blueshift.setCurrentLocation(18.5245649,73.7228812);
*
* @param {Number} latitude location latitude value.
* @param {Number} longitude location longitude value.
*
*/
function setCurrentLocation(latitude : number, longitude : number): void;
/**
* Calls Blueshift's live content API with email and given slot name and live content context.
*
* Usage -
* Blueshift.getLiveContentByEmail("testSlot",{},(err:any,result:any) => {
* if (result) {
* console.log(result);
* } else {
* console.log(err);
* }
* });
*
* @param {string} slot slot name of the live content.
* @param {object} lcContext live content context.
* @param {function} callback callback function.
*
*/
function getLiveContentByEmail(slot : string, lcContext : any, callback : function): void;
/**
* Calls Blueshift's live content API with customer id and given slot name and live content context.
*
* Usage -
* Blueshift.getLiveContentByCustomerId("testSlot",{},(err:any,result:any) => {
* if (result) {
* console.log(result);
* } else {
* console.log(err);
* }
* });
*
* @param {string} slot slot name of the live content.
* @param {object} lcContext live content context.
* @param {function} callback callback function.
*
*/
function getLiveContentByCustomerId(slot : string, lcContext : any, callback : function): void;
/**
* Calls Blueshift's live content API with device id and given slot name and live content context.
*
* Usage -
* Blueshift.getLiveContentByDeviceId("testSlot",{}(err:any,result:any) => {
* if (result) {
* console.log(result);
* } else {
* console.log(err);
* }
* });
*
* @param {string} slot slot name of the live content.
* @param {object} lcContext live content context.
* @param {function} callback callback function.
*
*/
function getLiveContentByDeviceId(slot : string, lcContext : any, callback : function): void;
/**
* Get opt-in or opt-out status of in-app notifications set in the SDK.
*
* Usage -
* Blueshift.getEnableInAppStatus((value: boolean) => {
* console.log("status"+value);
* });
*
* @param {function} callback success callback.
*
*/
function getEnableInAppStatus(callback : function): void;
/**
* Get opt-in or opt-out status of push notifications set in the SDK.
*
* Usage -
* Blueshift.getEnablePushStatus((value: boolean) => {
* console.log("status"+value);
* });
*
* @param {function} callback success callback.
*
*/
function getEnablePushStatus(callback : function): void;
/**
* Get status of event tracking set in the SDK.
*
* Usage -
* Blueshift.getEnableTrackingStatus((value: boolean) => {
* console.log("status"+value);
* });
*
* @param {function} callback success callback.
*
*/
function getEnableTrackingStatus(callback : function): void;
/**
* Get email id string set in the SDK.
*
* Usage -
* Blueshift.getUserInfoEmailId((value: string) => {
* console.log("Email id"+value);
* });
*
* @param {function} callback success callback.
*
*/
function getUserInfoEmailId(callback : function): void;
/**
* Get customer id string set in the SDK.
*
* Usage -
* Blueshift.getUserInfoCustomerId((value: string) => {
* console.log("Customer id"+value);
* });
*
* @param {function} callback success callback.
*
*/
function getUserInfoCustomerId(callback : function): void;
/**
* Get first name string set in the SDK.
*
* Usage -
* Blueshift.getUserInfoFirstName((value: string) => {
* console.log("First name"+value);
* });
*
* @param {function} callback success callback.
*
*/
function getUserInfoFirstName(callback : function): void;
/**
* Get last name string set in the SDK.
*
* Usage -
* Blueshift.getUserInfoLastName((value: string) => {
* console.log("Last name"+value);
* });
*
* @param {function} callback success callback.
*
*/
function getUserInfoLastName(callback : function): void;
/**
* Get extras JSON data set in the SDK.
*
* Usage -
* Blueshift.getUserInfoExtras((value: any) => {
* console.log("Extras"+value);
* });
*
* @param {function} callback success callback.
*
*/
function getUserInfoExtras(callback : function): void;
/**
* Get current device id string used by the SDK.
*
* Usage -
* Blueshift.getCurrentDeviceId((value: string) => {
* console.log("Device id"+value);
* });
*
* @param {function} callback success callback.
*
*/
function getCurrentDeviceId(callback : function): void;
/**
* Reset the current device id. This is only applicable if the device id
* source is set to GUID for Android or UUID for iOS.
*
* Usage -
* Blueshift.resetDeviceId();
*/
function resetDeviceId():void;
/**
* Sync Blueshift Inbox messages on the local cache.
* This will sync new messges, delete the expired messages, and update the unread status
* of the message to the locally cached messges.
*
* Usage -
* Blueshift.syncInboxMessages((status) => {
* if (status) {
* console.log("sync complete");
* }
* });
*/
function syncInboxMessages(callback: function): void;
/**
* Get unread messages count to show on the notification badge.
*
* Usage -
* Blueshift.getUnreadInboxMessageCount((count) => {
* console.log("unread messages count"+count);
* });
*/
function getUnreadInboxMessageCount(callback: function): void;
/**
* Get inbox messages list to show in the list view.
*
* Usage -
* Blueshift.getInboxMessages((messages) => {
* console.log("unread messages count"+count);
* });
*/
function getInboxMessages(callback: function): void;
/**
* Show in-app notification for the Inbox message.
*
* @param {BlueshiftInboxMessage} message
*
* Usage -
* Blueshift.showInboxMessage();
*/
function showInboxMessage(message: any): void;
/**
* Delete inbox message.
*
* @param {BlueshiftInboxMessage} message
*
* Usage -
* Blueshift.deleteInboxMessage();
*/
function deleteInboxMessage(message: any, callback: function): void;
/**
* Process the Blueshift url and provide the final url to Linking's "url" callback
*
* @param {string} url
*
*/
function processBlueshiftUrl(url : string): void;
/**
* Checks if the given Url is of Blueshift's format.
*
* @param {string} url
* @return {boolean}
*/
function isBlueshiftUrl(url : string): boolean;
}