@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.
Files changed (103) hide show
  1. package/android/src/main/java/com/zellosdk/ZelloAndroidSdkModule.kt +31 -22
  2. package/ios/Extensions/ZelloContact+Extension.swift +2 -0
  3. package/ios/Extensions/ZelloIOSSdkModule+Extension.swift +8 -5
  4. package/ios/ZelloIOSSdkModule.swift +43 -23
  5. package/ios/ZelloIOSSdkModuleBridge.m +11 -11
  6. package/lib/commonjs/docs/classes/sdk.Zello.html +48 -48
  7. package/lib/commonjs/docs/classes/types.ZelloAlertMessage.html +7 -7
  8. package/lib/commonjs/docs/classes/types.ZelloChannel.html +8 -8
  9. package/lib/commonjs/docs/classes/types.ZelloChannelUser.html +2 -2
  10. package/lib/commonjs/docs/classes/types.ZelloDispatchCall.html +4 -4
  11. package/lib/commonjs/docs/classes/types.ZelloDispatchChannel.html +9 -9
  12. package/lib/commonjs/docs/classes/types.ZelloGroupConversation.html +11 -11
  13. package/lib/commonjs/docs/classes/types.ZelloHistoryAlertMessage.html +8 -8
  14. package/lib/commonjs/docs/classes/types.ZelloHistoryImageMessage.html +7 -7
  15. package/lib/commonjs/docs/classes/types.ZelloHistoryLocationMessage.html +11 -11
  16. package/lib/commonjs/docs/classes/types.ZelloHistoryTextMessage.html +8 -8
  17. package/lib/commonjs/docs/classes/types.ZelloHistoryVoiceMessage.html +8 -8
  18. package/lib/commonjs/docs/classes/types.ZelloImageMessage.html +8 -8
  19. package/lib/commonjs/docs/classes/types.ZelloIncomingEmergency.html +7 -7
  20. package/lib/commonjs/docs/classes/types.ZelloIncomingVoiceMessage.html +6 -6
  21. package/lib/commonjs/docs/classes/types.ZelloLocationMessage.html +10 -10
  22. package/lib/commonjs/docs/classes/types.ZelloOutgoingEmergency.html +5 -5
  23. package/lib/commonjs/docs/classes/types.ZelloOutgoingVoiceMessage.html +7 -7
  24. package/lib/commonjs/docs/classes/types.ZelloRecentEntry.html +7 -7
  25. package/lib/commonjs/docs/classes/types.ZelloTextMessage.html +7 -7
  26. package/lib/commonjs/docs/classes/types.ZelloUser.html +9 -9
  27. package/lib/commonjs/docs/classes/types.ZelloUserSupportedFeatures.html +3 -3
  28. package/lib/commonjs/docs/enums/events.ZelloEvent.html +95 -95
  29. package/lib/commonjs/docs/enums/types.ZelloAccountStatus.html +4 -4
  30. package/lib/commonjs/docs/enums/types.ZelloChannelAlertLevel.html +4 -4
  31. package/lib/commonjs/docs/enums/types.ZelloChannelConnectionStatus.html +2 -2
  32. package/lib/commonjs/docs/enums/types.ZelloConnectionError.html +2 -2
  33. package/lib/commonjs/docs/enums/types.ZelloConnectionState.html +2 -2
  34. package/lib/commonjs/docs/enums/types.ZelloContactType.html +2 -2
  35. package/lib/commonjs/docs/enums/types.ZelloDispatchCallStatus.html +2 -2
  36. package/lib/commonjs/docs/enums/types.ZelloOutgoingVoiceMessageError.html +2 -2
  37. package/lib/commonjs/docs/enums/types.ZelloOutgoingVoiceMessageState.html +2 -2
  38. package/lib/commonjs/docs/enums/types.ZelloRecentEntryType.html +2 -2
  39. package/lib/commonjs/docs/enums/types.ZelloUserStatus.html +6 -6
  40. package/lib/commonjs/docs/modules/events.html +1 -1
  41. package/lib/commonjs/docs/modules/index.html +1 -1
  42. package/lib/commonjs/docs/modules/sdk.html +1 -1
  43. package/lib/commonjs/docs/modules/types.html +1 -1
  44. package/lib/commonjs/docs/types/types.ZelloChannelOptions.html +1 -1
  45. package/lib/commonjs/docs/types/types.ZelloConfig.html +1 -1
  46. package/lib/commonjs/docs/types/types.ZelloConsoleSettings.html +1 -1
  47. package/lib/commonjs/docs/types/types.ZelloContact.html +1 -1
  48. package/lib/commonjs/docs/types/types.ZelloCredentials.html +1 -1
  49. package/lib/commonjs/docs/types/types.ZelloHistoryMessage.html +1 -1
  50. package/lib/commonjs/docs/types/types.ZelloMessage.html +1 -1
  51. package/lib/commonjs/sdk/index.js +22 -33
  52. package/lib/commonjs/sdk/index.js.map +1 -1
  53. package/lib/module/docs/classes/sdk.Zello.html +48 -48
  54. package/lib/module/docs/classes/types.ZelloAlertMessage.html +7 -7
  55. package/lib/module/docs/classes/types.ZelloChannel.html +8 -8
  56. package/lib/module/docs/classes/types.ZelloChannelUser.html +2 -2
  57. package/lib/module/docs/classes/types.ZelloDispatchCall.html +4 -4
  58. package/lib/module/docs/classes/types.ZelloDispatchChannel.html +9 -9
  59. package/lib/module/docs/classes/types.ZelloGroupConversation.html +11 -11
  60. package/lib/module/docs/classes/types.ZelloHistoryAlertMessage.html +8 -8
  61. package/lib/module/docs/classes/types.ZelloHistoryImageMessage.html +7 -7
  62. package/lib/module/docs/classes/types.ZelloHistoryLocationMessage.html +11 -11
  63. package/lib/module/docs/classes/types.ZelloHistoryTextMessage.html +8 -8
  64. package/lib/module/docs/classes/types.ZelloHistoryVoiceMessage.html +8 -8
  65. package/lib/module/docs/classes/types.ZelloImageMessage.html +8 -8
  66. package/lib/module/docs/classes/types.ZelloIncomingEmergency.html +7 -7
  67. package/lib/module/docs/classes/types.ZelloIncomingVoiceMessage.html +6 -6
  68. package/lib/module/docs/classes/types.ZelloLocationMessage.html +10 -10
  69. package/lib/module/docs/classes/types.ZelloOutgoingEmergency.html +5 -5
  70. package/lib/module/docs/classes/types.ZelloOutgoingVoiceMessage.html +7 -7
  71. package/lib/module/docs/classes/types.ZelloRecentEntry.html +7 -7
  72. package/lib/module/docs/classes/types.ZelloTextMessage.html +7 -7
  73. package/lib/module/docs/classes/types.ZelloUser.html +9 -9
  74. package/lib/module/docs/classes/types.ZelloUserSupportedFeatures.html +3 -3
  75. package/lib/module/docs/enums/events.ZelloEvent.html +95 -95
  76. package/lib/module/docs/enums/types.ZelloAccountStatus.html +4 -4
  77. package/lib/module/docs/enums/types.ZelloChannelAlertLevel.html +4 -4
  78. package/lib/module/docs/enums/types.ZelloChannelConnectionStatus.html +2 -2
  79. package/lib/module/docs/enums/types.ZelloConnectionError.html +2 -2
  80. package/lib/module/docs/enums/types.ZelloConnectionState.html +2 -2
  81. package/lib/module/docs/enums/types.ZelloContactType.html +2 -2
  82. package/lib/module/docs/enums/types.ZelloDispatchCallStatus.html +2 -2
  83. package/lib/module/docs/enums/types.ZelloOutgoingVoiceMessageError.html +2 -2
  84. package/lib/module/docs/enums/types.ZelloOutgoingVoiceMessageState.html +2 -2
  85. package/lib/module/docs/enums/types.ZelloRecentEntryType.html +2 -2
  86. package/lib/module/docs/enums/types.ZelloUserStatus.html +6 -6
  87. package/lib/module/docs/modules/events.html +1 -1
  88. package/lib/module/docs/modules/index.html +1 -1
  89. package/lib/module/docs/modules/sdk.html +1 -1
  90. package/lib/module/docs/modules/types.html +1 -1
  91. package/lib/module/docs/types/types.ZelloChannelOptions.html +1 -1
  92. package/lib/module/docs/types/types.ZelloConfig.html +1 -1
  93. package/lib/module/docs/types/types.ZelloConsoleSettings.html +1 -1
  94. package/lib/module/docs/types/types.ZelloContact.html +1 -1
  95. package/lib/module/docs/types/types.ZelloCredentials.html +1 -1
  96. package/lib/module/docs/types/types.ZelloHistoryMessage.html +1 -1
  97. package/lib/module/docs/types/types.ZelloMessage.html +1 -1
  98. package/lib/module/sdk/index.js +22 -33
  99. package/lib/module/sdk/index.js.map +1 -1
  100. package/lib/typescript/commonjs/src/sdk/index.d.ts.map +1 -1
  101. package/lib/typescript/module/src/sdk/index.d.ts.map +1 -1
  102. package/package.json +2 -1
  103. 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, isChannel);
246
+ ZelloAndroidSdkModule.setSelectedContact(contact.name, contact.type);
248
247
  } else {
249
- ZelloIOSSdkModule.selectContact(contact.name, isChannel);
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, isChannel);
309
+ ZelloAndroidSdkModule.startVoiceMessage(contact.name, contact.type);
312
310
  } else {
313
- ZelloIOSSdkModule.startVoiceMessage(contact.name, isChannel);
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, isChannel, data);
335
+ ZelloAndroidSdkModule.sendImage(contact.name, contact.type, data);
339
336
  } else {
340
- ZelloIOSSdkModule.sendImage(contact.name, isChannel, data);
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, isChannel);
348
+ ZelloAndroidSdkModule.sendLocation(contact.name, contact.type);
353
349
  } else {
354
- ZelloIOSSdkModule.sendLocation(contact.name, isChannel);
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, isChannel, text);
362
+ ZelloAndroidSdkModule.sendText(contact.name, contact.type, text);
368
363
  } else {
369
- ZelloIOSSdkModule.sendText(contact.name, isChannel, text);
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, isChannel, text, level);
381
+ ZelloAndroidSdkModule.sendAlert(contact.name, contact.type, text, level);
388
382
  } else {
389
- ZelloIOSSdkModule.sendAlert(contact.name, isChannel, text, level);
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, isChannel);
406
+ ZelloAndroidSdkModule.muteContact(contact.name, contact.type);
414
407
  } else {
415
- ZelloIOSSdkModule.muteContact(contact.name, isChannel);
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, isChannel);
419
+ ZelloAndroidSdkModule.unmuteContact(contact.name, contact.type);
428
420
  } else {
429
- ZelloIOSSdkModule.unmuteContact(contact.name, isChannel);
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
- isChannel,
475
+ contact.type,
485
476
  size ?? defaultHistorySize,
486
477
  callback
487
478
  );
488
479
  } else {
489
480
  ZelloIOSSdkModule.getHistory(
490
481
  contact.name,
491
- isChannel,
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
- isChannel
500
+ message.contact.type
511
501
  );
512
502
  } else {
513
503
  ZelloIOSSdkModule.playHistoryMessage(
514
504
  message.historyId,
515
505
  message.contact.name,
516
- isChannel
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
- isChannel,
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
- isChannel,
543
+ message.contact.type,
555
544
  (data: string | undefined) => resolve(data)
556
545
  );
557
546
  }