@zelloptt/react-native-zello-sdk 1.0.0 → 1.0.1
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/android/src/main/java/com/zellosdk/ZelloAndroidSdkModule.kt +31 -22
- package/ios/Extensions/ZelloContact+Extension.swift +2 -0
- package/ios/Extensions/ZelloIOSSdkModule+Extension.swift +8 -5
- package/ios/ZelloIOSSdkModule.swift +43 -23
- package/ios/ZelloIOSSdkModuleBridge.m +11 -11
- package/lib/commonjs/docs/classes/sdk.Zello.html +48 -48
- package/lib/commonjs/docs/classes/types.ZelloAlertMessage.html +7 -7
- package/lib/commonjs/docs/classes/types.ZelloChannel.html +8 -8
- package/lib/commonjs/docs/classes/types.ZelloChannelUser.html +2 -2
- package/lib/commonjs/docs/classes/types.ZelloDispatchCall.html +4 -4
- package/lib/commonjs/docs/classes/types.ZelloDispatchChannel.html +9 -9
- package/lib/commonjs/docs/classes/types.ZelloGroupConversation.html +11 -11
- package/lib/commonjs/docs/classes/types.ZelloHistoryAlertMessage.html +8 -8
- package/lib/commonjs/docs/classes/types.ZelloHistoryImageMessage.html +7 -7
- package/lib/commonjs/docs/classes/types.ZelloHistoryLocationMessage.html +11 -11
- package/lib/commonjs/docs/classes/types.ZelloHistoryTextMessage.html +8 -8
- package/lib/commonjs/docs/classes/types.ZelloHistoryVoiceMessage.html +8 -8
- package/lib/commonjs/docs/classes/types.ZelloImageMessage.html +8 -8
- package/lib/commonjs/docs/classes/types.ZelloIncomingEmergency.html +7 -7
- package/lib/commonjs/docs/classes/types.ZelloIncomingVoiceMessage.html +6 -6
- package/lib/commonjs/docs/classes/types.ZelloLocationMessage.html +10 -10
- package/lib/commonjs/docs/classes/types.ZelloOutgoingEmergency.html +5 -5
- package/lib/commonjs/docs/classes/types.ZelloOutgoingVoiceMessage.html +7 -7
- package/lib/commonjs/docs/classes/types.ZelloRecentEntry.html +7 -7
- package/lib/commonjs/docs/classes/types.ZelloTextMessage.html +7 -7
- package/lib/commonjs/docs/classes/types.ZelloUser.html +9 -9
- package/lib/commonjs/docs/classes/types.ZelloUserSupportedFeatures.html +3 -3
- package/lib/commonjs/docs/enums/events.ZelloEvent.html +95 -95
- package/lib/commonjs/docs/enums/types.ZelloAccountStatus.html +4 -4
- package/lib/commonjs/docs/enums/types.ZelloChannelAlertLevel.html +4 -4
- package/lib/commonjs/docs/enums/types.ZelloChannelConnectionStatus.html +2 -2
- package/lib/commonjs/docs/enums/types.ZelloConnectionError.html +2 -2
- package/lib/commonjs/docs/enums/types.ZelloConnectionState.html +2 -2
- package/lib/commonjs/docs/enums/types.ZelloContactType.html +2 -2
- package/lib/commonjs/docs/enums/types.ZelloDispatchCallStatus.html +2 -2
- package/lib/commonjs/docs/enums/types.ZelloOutgoingVoiceMessageError.html +2 -2
- package/lib/commonjs/docs/enums/types.ZelloOutgoingVoiceMessageState.html +2 -2
- package/lib/commonjs/docs/enums/types.ZelloRecentEntryType.html +2 -2
- package/lib/commonjs/docs/enums/types.ZelloUserStatus.html +6 -6
- package/lib/commonjs/docs/modules/events.html +1 -1
- package/lib/commonjs/docs/modules/index.html +1 -1
- package/lib/commonjs/docs/modules/sdk.html +1 -1
- package/lib/commonjs/docs/modules/types.html +1 -1
- package/lib/commonjs/docs/types/types.ZelloChannelOptions.html +1 -1
- package/lib/commonjs/docs/types/types.ZelloConfig.html +1 -1
- package/lib/commonjs/docs/types/types.ZelloConsoleSettings.html +1 -1
- package/lib/commonjs/docs/types/types.ZelloContact.html +1 -1
- package/lib/commonjs/docs/types/types.ZelloCredentials.html +1 -1
- package/lib/commonjs/docs/types/types.ZelloHistoryMessage.html +1 -1
- package/lib/commonjs/docs/types/types.ZelloMessage.html +1 -1
- package/lib/commonjs/sdk/index.js +22 -33
- package/lib/commonjs/sdk/index.js.map +1 -1
- package/lib/module/docs/classes/sdk.Zello.html +48 -48
- package/lib/module/docs/classes/types.ZelloAlertMessage.html +7 -7
- package/lib/module/docs/classes/types.ZelloChannel.html +8 -8
- package/lib/module/docs/classes/types.ZelloChannelUser.html +2 -2
- package/lib/module/docs/classes/types.ZelloDispatchCall.html +4 -4
- package/lib/module/docs/classes/types.ZelloDispatchChannel.html +9 -9
- package/lib/module/docs/classes/types.ZelloGroupConversation.html +11 -11
- package/lib/module/docs/classes/types.ZelloHistoryAlertMessage.html +8 -8
- package/lib/module/docs/classes/types.ZelloHistoryImageMessage.html +7 -7
- package/lib/module/docs/classes/types.ZelloHistoryLocationMessage.html +11 -11
- package/lib/module/docs/classes/types.ZelloHistoryTextMessage.html +8 -8
- package/lib/module/docs/classes/types.ZelloHistoryVoiceMessage.html +8 -8
- package/lib/module/docs/classes/types.ZelloImageMessage.html +8 -8
- package/lib/module/docs/classes/types.ZelloIncomingEmergency.html +7 -7
- package/lib/module/docs/classes/types.ZelloIncomingVoiceMessage.html +6 -6
- package/lib/module/docs/classes/types.ZelloLocationMessage.html +10 -10
- package/lib/module/docs/classes/types.ZelloOutgoingEmergency.html +5 -5
- package/lib/module/docs/classes/types.ZelloOutgoingVoiceMessage.html +7 -7
- package/lib/module/docs/classes/types.ZelloRecentEntry.html +7 -7
- package/lib/module/docs/classes/types.ZelloTextMessage.html +7 -7
- package/lib/module/docs/classes/types.ZelloUser.html +9 -9
- package/lib/module/docs/classes/types.ZelloUserSupportedFeatures.html +3 -3
- package/lib/module/docs/enums/events.ZelloEvent.html +95 -95
- package/lib/module/docs/enums/types.ZelloAccountStatus.html +4 -4
- package/lib/module/docs/enums/types.ZelloChannelAlertLevel.html +4 -4
- package/lib/module/docs/enums/types.ZelloChannelConnectionStatus.html +2 -2
- package/lib/module/docs/enums/types.ZelloConnectionError.html +2 -2
- package/lib/module/docs/enums/types.ZelloConnectionState.html +2 -2
- package/lib/module/docs/enums/types.ZelloContactType.html +2 -2
- package/lib/module/docs/enums/types.ZelloDispatchCallStatus.html +2 -2
- package/lib/module/docs/enums/types.ZelloOutgoingVoiceMessageError.html +2 -2
- package/lib/module/docs/enums/types.ZelloOutgoingVoiceMessageState.html +2 -2
- package/lib/module/docs/enums/types.ZelloRecentEntryType.html +2 -2
- package/lib/module/docs/enums/types.ZelloUserStatus.html +6 -6
- package/lib/module/docs/modules/events.html +1 -1
- package/lib/module/docs/modules/index.html +1 -1
- package/lib/module/docs/modules/sdk.html +1 -1
- package/lib/module/docs/modules/types.html +1 -1
- package/lib/module/docs/types/types.ZelloChannelOptions.html +1 -1
- package/lib/module/docs/types/types.ZelloConfig.html +1 -1
- package/lib/module/docs/types/types.ZelloConsoleSettings.html +1 -1
- package/lib/module/docs/types/types.ZelloContact.html +1 -1
- package/lib/module/docs/types/types.ZelloCredentials.html +1 -1
- package/lib/module/docs/types/types.ZelloHistoryMessage.html +1 -1
- package/lib/module/docs/types/types.ZelloMessage.html +1 -1
- package/lib/module/sdk/index.js +22 -33
- package/lib/module/sdk/index.js.map +1 -1
- package/lib/typescript/commonjs/src/sdk/index.d.ts.map +1 -1
- package/lib/typescript/module/src/sdk/index.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/sdk/index.ts +22 -33
package/src/sdk/index.ts
CHANGED
|
@@ -242,11 +242,10 @@ export class Zello extends EventEmitter {
|
|
|
242
242
|
* @param contact The contact to set as selected.
|
|
243
243
|
*/
|
|
244
244
|
public setSelectedContact(contact: ZelloContact) {
|
|
245
|
-
const isChannel = contact.type === ZelloContactType.Channel;
|
|
246
245
|
if (isAndroid) {
|
|
247
|
-
ZelloAndroidSdkModule.setSelectedContact(contact.name,
|
|
246
|
+
ZelloAndroidSdkModule.setSelectedContact(contact.name, contact.type);
|
|
248
247
|
} else {
|
|
249
|
-
ZelloIOSSdkModule.selectContact(contact.name,
|
|
248
|
+
ZelloIOSSdkModule.selectContact(contact.name, contact.type);
|
|
250
249
|
}
|
|
251
250
|
}
|
|
252
251
|
|
|
@@ -306,11 +305,10 @@ export class Zello extends EventEmitter {
|
|
|
306
305
|
* @param contact The contact to start the voice message with.
|
|
307
306
|
*/
|
|
308
307
|
public startVoiceMessage(contact: ZelloContact) {
|
|
309
|
-
const isChannel = contact.type === ZelloContactType.Channel;
|
|
310
308
|
if (isAndroid) {
|
|
311
|
-
ZelloAndroidSdkModule.startVoiceMessage(contact.name,
|
|
309
|
+
ZelloAndroidSdkModule.startVoiceMessage(contact.name, contact.type);
|
|
312
310
|
} else {
|
|
313
|
-
ZelloIOSSdkModule.startVoiceMessage(contact.name,
|
|
311
|
+
ZelloIOSSdkModule.startVoiceMessage(contact.name, contact.type);
|
|
314
312
|
}
|
|
315
313
|
}
|
|
316
314
|
|
|
@@ -333,11 +331,10 @@ export class Zello extends EventEmitter {
|
|
|
333
331
|
* @param data The image data to send.
|
|
334
332
|
*/
|
|
335
333
|
public sendImage(contact: ZelloContact, data: number[]) {
|
|
336
|
-
const isChannel = contact.type === ZelloContactType.Channel;
|
|
337
334
|
if (isAndroid) {
|
|
338
|
-
ZelloAndroidSdkModule.sendImage(contact.name,
|
|
335
|
+
ZelloAndroidSdkModule.sendImage(contact.name, contact.type, data);
|
|
339
336
|
} else {
|
|
340
|
-
ZelloIOSSdkModule.sendImage(contact.name,
|
|
337
|
+
ZelloIOSSdkModule.sendImage(contact.name, contact.type, data);
|
|
341
338
|
}
|
|
342
339
|
}
|
|
343
340
|
|
|
@@ -347,11 +344,10 @@ export class Zello extends EventEmitter {
|
|
|
347
344
|
* @param contact The contact to send the alert to.
|
|
348
345
|
*/
|
|
349
346
|
public sendLocation(contact: ZelloContact) {
|
|
350
|
-
const isChannel = contact.type === ZelloContactType.Channel;
|
|
351
347
|
if (isAndroid) {
|
|
352
|
-
ZelloAndroidSdkModule.sendLocation(contact.name,
|
|
348
|
+
ZelloAndroidSdkModule.sendLocation(contact.name, contact.type);
|
|
353
349
|
} else {
|
|
354
|
-
ZelloIOSSdkModule.sendLocation(contact.name,
|
|
350
|
+
ZelloIOSSdkModule.sendLocation(contact.name, contact.type);
|
|
355
351
|
}
|
|
356
352
|
}
|
|
357
353
|
|
|
@@ -362,11 +358,10 @@ export class Zello extends EventEmitter {
|
|
|
362
358
|
* @param text The text to send.
|
|
363
359
|
*/
|
|
364
360
|
public sendText(contact: ZelloContact, text: string) {
|
|
365
|
-
const isChannel = contact.type === ZelloContactType.Channel;
|
|
366
361
|
if (isAndroid) {
|
|
367
|
-
ZelloAndroidSdkModule.sendText(contact.name,
|
|
362
|
+
ZelloAndroidSdkModule.sendText(contact.name, contact.type, text);
|
|
368
363
|
} else {
|
|
369
|
-
ZelloIOSSdkModule.sendText(contact.name,
|
|
364
|
+
ZelloIOSSdkModule.sendText(contact.name, contact.type, text);
|
|
370
365
|
}
|
|
371
366
|
}
|
|
372
367
|
|
|
@@ -382,11 +377,10 @@ export class Zello extends EventEmitter {
|
|
|
382
377
|
text: string,
|
|
383
378
|
level?: ZelloChannelAlertLevel
|
|
384
379
|
) {
|
|
385
|
-
const isChannel = contact.type === ZelloContactType.Channel;
|
|
386
380
|
if (isAndroid) {
|
|
387
|
-
ZelloAndroidSdkModule.sendAlert(contact.name,
|
|
381
|
+
ZelloAndroidSdkModule.sendAlert(contact.name, contact.type, text, level);
|
|
388
382
|
} else {
|
|
389
|
-
ZelloIOSSdkModule.sendAlert(contact.name,
|
|
383
|
+
ZelloIOSSdkModule.sendAlert(contact.name, contact.type, text, level);
|
|
390
384
|
}
|
|
391
385
|
}
|
|
392
386
|
|
|
@@ -408,11 +402,10 @@ export class Zello extends EventEmitter {
|
|
|
408
402
|
* @param contact The contact to mute.
|
|
409
403
|
*/
|
|
410
404
|
public muteContact(contact: ZelloContact) {
|
|
411
|
-
const isChannel = contact.type === ZelloContactType.Channel;
|
|
412
405
|
if (isAndroid) {
|
|
413
|
-
ZelloAndroidSdkModule.muteContact(contact.name,
|
|
406
|
+
ZelloAndroidSdkModule.muteContact(contact.name, contact.type);
|
|
414
407
|
} else {
|
|
415
|
-
ZelloIOSSdkModule.muteContact(contact.name,
|
|
408
|
+
ZelloIOSSdkModule.muteContact(contact.name, contact.type);
|
|
416
409
|
}
|
|
417
410
|
}
|
|
418
411
|
|
|
@@ -422,11 +415,10 @@ export class Zello extends EventEmitter {
|
|
|
422
415
|
* @param contact The contact to unmute.
|
|
423
416
|
*/
|
|
424
417
|
public unmuteContact(contact: ZelloContact) {
|
|
425
|
-
const isChannel = contact.type === ZelloContactType.Channel;
|
|
426
418
|
if (isAndroid) {
|
|
427
|
-
ZelloAndroidSdkModule.unmuteContact(contact.name,
|
|
419
|
+
ZelloAndroidSdkModule.unmuteContact(contact.name, contact.type);
|
|
428
420
|
} else {
|
|
429
|
-
ZelloIOSSdkModule.unmuteContact(contact.name,
|
|
421
|
+
ZelloIOSSdkModule.unmuteContact(contact.name, contact.type);
|
|
430
422
|
}
|
|
431
423
|
}
|
|
432
424
|
|
|
@@ -467,7 +459,6 @@ export class Zello extends EventEmitter {
|
|
|
467
459
|
): Promise<ZelloHistoryMessage[]> {
|
|
468
460
|
const defaultHistorySize = 50;
|
|
469
461
|
return new Promise((resolve) => {
|
|
470
|
-
const isChannel = contact.type === ZelloContactType.Channel;
|
|
471
462
|
const callback = (history: any[] | undefined) => {
|
|
472
463
|
if (!history) {
|
|
473
464
|
resolve([]);
|
|
@@ -481,14 +472,14 @@ export class Zello extends EventEmitter {
|
|
|
481
472
|
if (isAndroid) {
|
|
482
473
|
ZelloAndroidSdkModule.getHistory(
|
|
483
474
|
contact.name,
|
|
484
|
-
|
|
475
|
+
contact.type,
|
|
485
476
|
size ?? defaultHistorySize,
|
|
486
477
|
callback
|
|
487
478
|
);
|
|
488
479
|
} else {
|
|
489
480
|
ZelloIOSSdkModule.getHistory(
|
|
490
481
|
contact.name,
|
|
491
|
-
|
|
482
|
+
contact.type,
|
|
492
483
|
size ?? defaultHistorySize,
|
|
493
484
|
callback
|
|
494
485
|
);
|
|
@@ -502,18 +493,17 @@ export class Zello extends EventEmitter {
|
|
|
502
493
|
* @param message The history message to play.
|
|
503
494
|
*/
|
|
504
495
|
public playHistoryMessage(message: ZelloHistoryVoiceMessage) {
|
|
505
|
-
const isChannel = message.contact.type === ZelloContactType.Channel;
|
|
506
496
|
if (isAndroid) {
|
|
507
497
|
ZelloAndroidSdkModule.playHistoryMessage(
|
|
508
498
|
message.historyId,
|
|
509
499
|
message.contact.name,
|
|
510
|
-
|
|
500
|
+
message.contact.type
|
|
511
501
|
);
|
|
512
502
|
} else {
|
|
513
503
|
ZelloIOSSdkModule.playHistoryMessage(
|
|
514
504
|
message.historyId,
|
|
515
505
|
message.contact.name,
|
|
516
|
-
|
|
506
|
+
message.contact.type
|
|
517
507
|
);
|
|
518
508
|
}
|
|
519
509
|
}
|
|
@@ -539,19 +529,18 @@ export class Zello extends EventEmitter {
|
|
|
539
529
|
message: ZelloHistoryImageMessage
|
|
540
530
|
): Promise<string | undefined> {
|
|
541
531
|
return new Promise((resolve) => {
|
|
542
|
-
const isChannel = message.contact.type === ZelloContactType.Channel;
|
|
543
532
|
if (isAndroid) {
|
|
544
533
|
ZelloAndroidSdkModule.getImageDataForHistoryImageMessage(
|
|
545
534
|
message.historyId,
|
|
546
535
|
message.contact.name,
|
|
547
|
-
|
|
536
|
+
message.contact.type,
|
|
548
537
|
(data: string | undefined) => resolve(data)
|
|
549
538
|
);
|
|
550
539
|
} else {
|
|
551
540
|
ZelloIOSSdkModule.getHistoryImageData(
|
|
552
541
|
message.historyId,
|
|
553
542
|
message.contact.name,
|
|
554
|
-
|
|
543
|
+
message.contact.type,
|
|
555
544
|
(data: string | undefined) => resolve(data)
|
|
556
545
|
);
|
|
557
546
|
}
|