@stream-io/react-native-callingx 0.1.0-beta.7 → 0.1.1-beta.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 (45) hide show
  1. package/android/build.gradle +7 -1
  2. package/android/src/main/AndroidManifest.xml +31 -1
  3. package/android/src/main/java/io/getstream/rn/callingx/CallEventBroadcastReceiver.kt +17 -0
  4. package/android/src/main/java/io/getstream/rn/callingx/CallRegistrationStore.kt +145 -0
  5. package/android/src/main/java/io/getstream/rn/callingx/CallService.kt +301 -83
  6. package/android/src/main/java/io/getstream/rn/callingx/CallingxModuleImpl.kt +148 -390
  7. package/android/src/main/java/io/getstream/rn/callingx/StreamMessagingService.kt +48 -0
  8. package/android/src/main/java/io/getstream/rn/callingx/model/Call.kt +1 -0
  9. package/android/src/main/java/io/getstream/rn/callingx/notifications/CallNotificationManager.kt +188 -48
  10. package/android/src/main/java/io/getstream/rn/callingx/notifications/NotificationIntentFactory.kt +14 -8
  11. package/android/src/main/java/io/getstream/rn/callingx/notifications/NotificationReceiverActivity.kt +12 -1
  12. package/android/src/main/java/io/getstream/rn/callingx/notifications/NotificationReceiverService.kt +7 -0
  13. package/android/src/main/java/io/getstream/rn/callingx/repo/CallRepository.kt +38 -19
  14. package/android/src/main/java/io/getstream/rn/callingx/repo/LegacyCallRepository.kt +64 -55
  15. package/android/src/main/java/io/getstream/rn/callingx/repo/TelecomCallRepository.kt +241 -195
  16. package/android/src/main/java/io/getstream/rn/callingx/utils/CallEventBus.kt +61 -0
  17. package/android/src/main/java/io/getstream/rn/callingx/utils/SettingsStore.kt +51 -0
  18. package/android/src/newarch/java/io/getstream/rn/callingx/CallingxModule.kt +12 -3
  19. package/android/src/oldarch/java/io/getstream/rn/callingx/CallingxModule.kt +13 -3
  20. package/dist/module/CallingxModule.js +20 -24
  21. package/dist/module/CallingxModule.js.map +1 -1
  22. package/dist/module/spec/NativeCallingx.js.map +1 -1
  23. package/dist/module/utils/constants.js +24 -14
  24. package/dist/module/utils/constants.js.map +1 -1
  25. package/dist/typescript/src/CallingxModule.d.ts +4 -2
  26. package/dist/typescript/src/CallingxModule.d.ts.map +1 -1
  27. package/dist/typescript/src/spec/NativeCallingx.d.ts +7 -4
  28. package/dist/typescript/src/spec/NativeCallingx.d.ts.map +1 -1
  29. package/dist/typescript/src/types.d.ts +33 -5
  30. package/dist/typescript/src/types.d.ts.map +1 -1
  31. package/dist/typescript/src/utils/constants.d.ts +2 -3
  32. package/dist/typescript/src/utils/constants.d.ts.map +1 -1
  33. package/ios/AudioSessionManager.swift +2 -2
  34. package/ios/Callingx.mm +41 -17
  35. package/ios/CallingxImpl.swift +213 -83
  36. package/ios/Settings.swift +2 -2
  37. package/ios/UUIDStorage.swift +10 -10
  38. package/ios/VoipNotificationsManager.swift +8 -8
  39. package/package.json +4 -2
  40. package/src/CallingxModule.ts +20 -21
  41. package/src/spec/NativeCallingx.ts +10 -6
  42. package/src/types.ts +36 -4
  43. package/src/utils/constants.ts +23 -12
  44. /package/android/src/main/java/io/getstream/rn/callingx/{ResourceUtils.kt → utils/ResourceUtils.kt} +0 -0
  45. /package/android/src/main/java/io/getstream/rn/callingx/{Utils.kt → utils/Utils.kt} +0 -0
@@ -6,7 +6,7 @@ import stream_react_native_webrtc
6
6
 
7
7
  public static func createAudioSessionIfNeeded() {
8
8
  #if DEBUG
9
- print("[Callingx][createAudioSessionIfNeeded] Creating audio session")
9
+ NSLog("%@","[Callingx][createAudioSessionIfNeeded] Creating audio session")
10
10
  #endif
11
11
 
12
12
  let categoryOptions: AVAudioSession.CategoryOptions
@@ -34,7 +34,7 @@ import stream_react_native_webrtc
34
34
  try rtcSession.setConfiguration(rtcConfig)
35
35
  } catch {
36
36
  #if DEBUG
37
- print("[Callingx][createAudioSessionIfNeeded] Error configuring audio session: \(error)")
37
+ NSLog("%@","[Callingx][createAudioSessionIfNeeded] Error configuring audio session: \(error)")
38
38
  #endif
39
39
  }
40
40
  }
package/ios/Callingx.mm CHANGED
@@ -101,7 +101,7 @@ RCT_EXPORT_MODULE(Callingx)
101
101
 
102
102
  - (instancetype)init {
103
103
  if (self = [super init]) {
104
- _moduleImpl = [[CallingxImpl alloc] init];
104
+ _moduleImpl = [CallingxImpl getSharedInstance];
105
105
  _moduleImpl.eventEmitter = self;
106
106
 
107
107
  [VoipNotificationsManager shared].eventEmitter = self;
@@ -209,6 +209,22 @@ RCT_EXPORT_METHOD(setupAndroid:(NSDictionary *)options) {
209
209
  }
210
210
  #endif
211
211
 
212
+ #pragma mark - stopService
213
+
214
+ #ifdef RCT_NEW_ARCH_ENABLED
215
+ - (void)stopService:(RCTPromiseResolveBlock)resolve
216
+ reject:(RCTPromiseRejectBlock)reject {
217
+ // Not implemented on iOS
218
+ resolve(@YES);
219
+ }
220
+ #else
221
+ RCT_EXPORT_METHOD(stopService:(RCTPromiseResolveBlock)resolve
222
+ reject:(RCTPromiseRejectBlock)reject) {
223
+ // Not implemented on iOS
224
+ resolve(@YES);
225
+ }
226
+
227
+ #endif
212
228
  #pragma mark - setShouldRejectCallWhenBusy
213
229
 
214
230
  #ifdef RCT_NEW_ARCH_ENABLED
@@ -491,6 +507,30 @@ RCT_EXPORT_METHOD(updateDisplay:(NSString *)callId
491
507
  }
492
508
  #endif
493
509
 
510
+ #pragma mark - fulfillAnswerCallAction
511
+
512
+ #ifdef RCT_NEW_ARCH_ENABLED
513
+ - (void)fulfillAnswerCallAction:(NSString *)callId didFail:(BOOL)didFail {
514
+ [_moduleImpl fulfillAnswerCallAction:callId didFail:didFail];
515
+ }
516
+ #else
517
+ RCT_EXPORT_METHOD(fulfillAnswerCallAction:(NSString *)callId didFail:(BOOL)didFail) {
518
+ [_moduleImpl fulfillAnswerCallAction:callId didFail:didFail];
519
+ }
520
+ #endif
521
+
522
+ #pragma mark - fulfillEndCallAction
523
+
524
+ #ifdef RCT_NEW_ARCH_ENABLED
525
+ - (void)fulfillEndCallAction:(NSString *)callId didFail:(BOOL)didFail {
526
+ [_moduleImpl fulfillEndCallAction:callId didFail:didFail];
527
+ }
528
+ #else
529
+ RCT_EXPORT_METHOD(fulfillEndCallAction:(NSString *)callId didFail:(BOOL)didFail) {
530
+ [_moduleImpl fulfillEndCallAction:callId didFail:didFail];
531
+ }
532
+ #endif
533
+
494
534
  #pragma mark - log
495
535
 
496
536
  #ifdef RCT_NEW_ARCH_ENABLED
@@ -553,22 +593,6 @@ RCT_EXPORT_METHOD(registerBackgroundTaskAvailable) {
553
593
  }
554
594
  #endif
555
595
 
556
- #pragma mark - isServiceStarted
557
-
558
- #ifdef RCT_NEW_ARCH_ENABLED
559
- - (void)isServiceStarted:(RCTPromiseResolveBlock)resolve
560
- reject:(RCTPromiseRejectBlock)reject {
561
- // iOS doesn't use a service like Android, always return true
562
- resolve(@YES);
563
- }
564
- #else
565
- RCT_EXPORT_METHOD(isServiceStarted:(RCTPromiseResolveBlock)resolve
566
- reject:(RCTPromiseRejectBlock)reject) {
567
- // iOS doesn't use a service like Android, always return true
568
- resolve(@YES);
569
- }
570
- #endif
571
-
572
596
  #pragma mark - canPostNotifications
573
597
 
574
598
  #ifdef RCT_NEW_ARCH_ENABLED