@stream-io/video-react-native-sdk 1.29.0-beta.1 → 1.29.0

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 (198) hide show
  1. package/CHANGELOG.md +3114 -0
  2. package/android/src/main/AndroidManifest.xml +1 -8
  3. package/android/src/main/AndroidManifestNew.xml +0 -11
  4. package/android/src/main/java/com/streamvideo/reactnative/StreamVideoReactNativeModule.kt +5 -42
  5. package/android/src/main/java/com/streamvideo/reactnative/audio/utils/WebRtcAudioUtils.kt +6 -70
  6. package/android/src/main/java/com/streamvideo/reactnative/callmanager/StreamInCallManagerModule.kt +4 -6
  7. package/android/src/main/java/com/streamvideo/reactnative/util/CallAliveServiceChecker.kt +95 -0
  8. package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js +160 -0
  9. package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -0
  10. package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js +31 -18
  11. package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
  12. package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js +97 -64
  13. package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
  14. package/dist/commonjs/index.js +0 -1
  15. package/dist/commonjs/index.js.map +1 -1
  16. package/dist/commonjs/modules/call-manager/CallManager.js +0 -26
  17. package/dist/commonjs/modules/call-manager/CallManager.js.map +1 -1
  18. package/dist/commonjs/providers/StreamCall/index.js +6 -6
  19. package/dist/commonjs/providers/StreamCall/index.js.map +1 -1
  20. package/dist/commonjs/utils/StreamVideoRN/index.js +21 -33
  21. package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
  22. package/dist/commonjs/utils/internal/registerSDKGlobals.js +3 -52
  23. package/dist/commonjs/utils/internal/registerSDKGlobals.js.map +1 -1
  24. package/dist/commonjs/utils/push/android.js +200 -145
  25. package/dist/commonjs/utils/push/android.js.map +1 -1
  26. package/dist/commonjs/utils/push/internal/ios.js +34 -16
  27. package/dist/commonjs/utils/push/internal/ios.js.map +1 -1
  28. package/dist/commonjs/utils/push/internal/rxSubjects.js +20 -1
  29. package/dist/commonjs/utils/push/internal/rxSubjects.js.map +1 -1
  30. package/dist/commonjs/utils/push/internal/utils.js +1 -17
  31. package/dist/commonjs/utils/push/internal/utils.js.map +1 -1
  32. package/dist/commonjs/utils/push/ios.js.map +1 -1
  33. package/dist/commonjs/utils/push/libs/callkeep.js +17 -0
  34. package/dist/commonjs/utils/push/libs/callkeep.js.map +1 -0
  35. package/dist/commonjs/utils/push/libs/index.js +19 -8
  36. package/dist/commonjs/utils/push/libs/index.js.map +1 -1
  37. package/dist/commonjs/utils/push/libs/notifee/index.js +19 -0
  38. package/dist/commonjs/utils/push/libs/notifee/index.js.map +1 -1
  39. package/dist/commonjs/utils/push/libs/voipPushNotification.js +17 -0
  40. package/dist/commonjs/utils/push/libs/voipPushNotification.js.map +1 -0
  41. package/dist/commonjs/utils/push/setupIosCallKeepEvents.js +205 -0
  42. package/dist/commonjs/utils/push/setupIosCallKeepEvents.js.map +1 -0
  43. package/dist/commonjs/utils/push/setupIosVoipPushEvents.js +6 -7
  44. package/dist/commonjs/utils/push/setupIosVoipPushEvents.js.map +1 -1
  45. package/dist/commonjs/version.js +1 -1
  46. package/dist/commonjs/version.js.map +1 -1
  47. package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js +153 -0
  48. package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -0
  49. package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js +31 -18
  50. package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
  51. package/dist/module/hooks/useAndroidKeepCallAliveEffect.js +99 -66
  52. package/dist/module/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
  53. package/dist/module/index.js +0 -1
  54. package/dist/module/index.js.map +1 -1
  55. package/dist/module/modules/call-manager/CallManager.js +0 -26
  56. package/dist/module/modules/call-manager/CallManager.js.map +1 -1
  57. package/dist/module/providers/StreamCall/index.js +6 -6
  58. package/dist/module/providers/StreamCall/index.js.map +1 -1
  59. package/dist/module/utils/StreamVideoRN/index.js +21 -33
  60. package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
  61. package/dist/module/utils/internal/registerSDKGlobals.js +4 -53
  62. package/dist/module/utils/internal/registerSDKGlobals.js.map +1 -1
  63. package/dist/module/utils/push/android.js +202 -147
  64. package/dist/module/utils/push/android.js.map +1 -1
  65. package/dist/module/utils/push/internal/ios.js +34 -16
  66. package/dist/module/utils/push/internal/ios.js.map +1 -1
  67. package/dist/module/utils/push/internal/rxSubjects.js +19 -0
  68. package/dist/module/utils/push/internal/rxSubjects.js.map +1 -1
  69. package/dist/module/utils/push/internal/utils.js +0 -14
  70. package/dist/module/utils/push/internal/utils.js.map +1 -1
  71. package/dist/module/utils/push/ios.js.map +1 -1
  72. package/dist/module/utils/push/libs/callkeep.js +11 -0
  73. package/dist/module/utils/push/libs/callkeep.js.map +1 -0
  74. package/dist/module/utils/push/libs/index.js +2 -1
  75. package/dist/module/utils/push/libs/index.js.map +1 -1
  76. package/dist/module/utils/push/libs/notifee/index.js +18 -0
  77. package/dist/module/utils/push/libs/notifee/index.js.map +1 -1
  78. package/dist/module/utils/push/libs/voipPushNotification.js +11 -0
  79. package/dist/module/utils/push/libs/voipPushNotification.js.map +1 -0
  80. package/dist/module/utils/push/setupIosCallKeepEvents.js +199 -0
  81. package/dist/module/utils/push/setupIosCallKeepEvents.js.map +1 -0
  82. package/dist/module/utils/push/setupIosVoipPushEvents.js +6 -7
  83. package/dist/module/utils/push/setupIosVoipPushEvents.js.map +1 -1
  84. package/dist/module/version.js +1 -1
  85. package/dist/module/version.js.map +1 -1
  86. package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts +5 -0
  87. package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts.map +1 -0
  88. package/dist/typescript/hooks/push/useIosVoipPushEventsSetupEffect.d.ts.map +1 -1
  89. package/dist/typescript/hooks/useAndroidKeepCallAliveEffect.d.ts.map +1 -1
  90. package/dist/typescript/index.d.ts +0 -1
  91. package/dist/typescript/index.d.ts.map +1 -1
  92. package/dist/typescript/modules/call-manager/CallManager.d.ts +0 -5
  93. package/dist/typescript/modules/call-manager/CallManager.d.ts.map +1 -1
  94. package/dist/typescript/utils/StreamVideoRN/index.d.ts +2 -20
  95. package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
  96. package/dist/typescript/utils/StreamVideoRN/types.d.ts +29 -54
  97. package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
  98. package/dist/typescript/utils/internal/registerSDKGlobals.d.ts.map +1 -1
  99. package/dist/typescript/utils/push/android.d.ts +2 -1
  100. package/dist/typescript/utils/push/android.d.ts.map +1 -1
  101. package/dist/typescript/utils/push/internal/ios.d.ts.map +1 -1
  102. package/dist/typescript/utils/push/internal/rxSubjects.d.ts +12 -0
  103. package/dist/typescript/utils/push/internal/rxSubjects.d.ts.map +1 -1
  104. package/dist/typescript/utils/push/internal/utils.d.ts +0 -4
  105. package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -1
  106. package/dist/typescript/utils/push/ios.d.ts +2 -1
  107. package/dist/typescript/utils/push/ios.d.ts.map +1 -1
  108. package/dist/typescript/utils/push/libs/callkeep.d.ts +3 -0
  109. package/dist/typescript/utils/push/libs/callkeep.d.ts.map +1 -0
  110. package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts +2 -16
  111. package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts.map +1 -1
  112. package/dist/typescript/utils/push/libs/index.d.ts +2 -1
  113. package/dist/typescript/utils/push/libs/index.d.ts.map +1 -1
  114. package/dist/typescript/utils/push/libs/notifee/index.d.ts +1 -0
  115. package/dist/typescript/utils/push/libs/notifee/index.d.ts.map +1 -1
  116. package/dist/typescript/utils/push/libs/voipPushNotification.d.ts +3 -0
  117. package/dist/typescript/utils/push/libs/voipPushNotification.d.ts.map +1 -0
  118. package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts +6 -0
  119. package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts.map +1 -0
  120. package/dist/typescript/utils/push/setupIosVoipPushEvents.d.ts.map +1 -1
  121. package/dist/typescript/version.d.ts +1 -1
  122. package/dist/typescript/version.d.ts.map +1 -1
  123. package/expo-config-plugin/dist/withAndroidManifest.js +33 -1
  124. package/expo-config-plugin/dist/withAndroidPermissions.js +7 -2
  125. package/expo-config-plugin/dist/withAppDelegate.js +197 -19
  126. package/expo-config-plugin/dist/withMainActivity.js +1 -1
  127. package/expo-config-plugin/dist/withiOSInfoPlist.js +3 -2
  128. package/ios/StreamInCallManager.m +0 -2
  129. package/ios/StreamInCallManager.swift +5 -20
  130. package/ios/StreamVideoReactNative.h +4 -7
  131. package/ios/StreamVideoReactNative.m +82 -191
  132. package/package.json +17 -12
  133. package/src/hooks/push/useIosCallkeepWithCallingStateEffect.ts +235 -0
  134. package/src/hooks/push/useIosVoipPushEventsSetupEffect.ts +34 -21
  135. package/src/hooks/useAndroidKeepCallAliveEffect.ts +120 -94
  136. package/src/index.ts +0 -1
  137. package/src/modules/call-manager/CallManager.ts +0 -36
  138. package/src/modules/call-manager/native-module.d.ts +0 -7
  139. package/src/providers/StreamCall/index.tsx +6 -6
  140. package/src/utils/StreamVideoRN/index.ts +30 -40
  141. package/src/utils/StreamVideoRN/types.ts +29 -56
  142. package/src/utils/internal/registerSDKGlobals.ts +4 -47
  143. package/src/utils/push/android.ts +308 -223
  144. package/src/utils/push/internal/ios.ts +46 -25
  145. package/src/utils/push/internal/rxSubjects.ts +29 -0
  146. package/src/utils/push/internal/utils.ts +0 -25
  147. package/src/utils/push/ios.ts +6 -1
  148. package/src/utils/push/libs/callkeep.ts +16 -0
  149. package/src/utils/push/libs/index.ts +2 -1
  150. package/src/utils/push/libs/notifee/index.ts +27 -0
  151. package/src/utils/push/libs/voipPushNotification.ts +17 -0
  152. package/src/utils/push/setupIosCallKeepEvents.ts +252 -0
  153. package/src/utils/push/setupIosVoipPushEvents.ts +7 -11
  154. package/src/version.ts +1 -1
  155. package/android/src/main/java/com/streamvideo/reactnative/keepalive/KeepAliveNotification.kt +0 -83
  156. package/android/src/main/java/com/streamvideo/reactnative/keepalive/StreamCallKeepAliveHeadlessService.kt +0 -134
  157. package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js +0 -216
  158. package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js.map +0 -1
  159. package/dist/commonjs/utils/internal/audioSessionPromise.js +0 -46
  160. package/dist/commonjs/utils/internal/audioSessionPromise.js.map +0 -1
  161. package/dist/commonjs/utils/internal/callingx.js +0 -84
  162. package/dist/commonjs/utils/internal/callingx.js.map +0 -1
  163. package/dist/commonjs/utils/keepCallAliveHeadlessTask.js +0 -48
  164. package/dist/commonjs/utils/keepCallAliveHeadlessTask.js.map +0 -1
  165. package/dist/commonjs/utils/push/libs/callingx.js +0 -75
  166. package/dist/commonjs/utils/push/libs/callingx.js.map +0 -1
  167. package/dist/commonjs/utils/push/setupCallingExpEvents.js +0 -97
  168. package/dist/commonjs/utils/push/setupCallingExpEvents.js.map +0 -1
  169. package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js +0 -209
  170. package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js.map +0 -1
  171. package/dist/module/utils/internal/audioSessionPromise.js +0 -39
  172. package/dist/module/utils/internal/audioSessionPromise.js.map +0 -1
  173. package/dist/module/utils/internal/callingx.js +0 -75
  174. package/dist/module/utils/internal/callingx.js.map +0 -1
  175. package/dist/module/utils/keepCallAliveHeadlessTask.js +0 -42
  176. package/dist/module/utils/keepCallAliveHeadlessTask.js.map +0 -1
  177. package/dist/module/utils/push/libs/callingx.js +0 -67
  178. package/dist/module/utils/push/libs/callingx.js.map +0 -1
  179. package/dist/module/utils/push/setupCallingExpEvents.js +0 -91
  180. package/dist/module/utils/push/setupCallingExpEvents.js.map +0 -1
  181. package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts +0 -5
  182. package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts.map +0 -1
  183. package/dist/typescript/utils/internal/audioSessionPromise.d.ts +0 -16
  184. package/dist/typescript/utils/internal/audioSessionPromise.d.ts.map +0 -1
  185. package/dist/typescript/utils/internal/callingx.d.ts +0 -13
  186. package/dist/typescript/utils/internal/callingx.d.ts.map +0 -1
  187. package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts +0 -10
  188. package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts.map +0 -1
  189. package/dist/typescript/utils/push/libs/callingx.d.ts +0 -9
  190. package/dist/typescript/utils/push/libs/callingx.d.ts.map +0 -1
  191. package/dist/typescript/utils/push/setupCallingExpEvents.d.ts +0 -8
  192. package/dist/typescript/utils/push/setupCallingExpEvents.d.ts.map +0 -1
  193. package/src/hooks/push/useCallingExpWithCallingStateEffect.ts +0 -307
  194. package/src/utils/internal/audioSessionPromise.ts +0 -39
  195. package/src/utils/internal/callingx.ts +0 -108
  196. package/src/utils/keepCallAliveHeadlessTask.ts +0 -54
  197. package/src/utils/push/libs/callingx.ts +0 -90
  198. package/src/utils/push/setupCallingExpEvents.ts +0 -117
@@ -2,13 +2,6 @@
2
2
  package="com.streamvideo.reactnative">
3
3
 
4
4
  <uses-permission android:name="android.permission.INTERNET" />
5
+ <uses-permission android:name="android.permission.DEVICE_POWER" />
5
6
  <uses-permission android:name="android.permission.WAKE_LOCK" />
6
-
7
- <application>
8
- <service
9
- android:name="com.streamvideo.reactnative.keepalive.StreamCallKeepAliveHeadlessService"
10
- android:exported="false"
11
- android:stopWithTask="true"
12
- android:foregroundServiceType="mediaPlayback|camera|microphone" />
13
- </application>
14
7
  </manifest>
@@ -1,13 +1,2 @@
1
1
  <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
-
3
- <uses-permission android:name="android.permission.INTERNET" />
4
- <uses-permission android:name="android.permission.WAKE_LOCK" />
5
-
6
- <application>
7
- <service
8
- android:name="com.streamvideo.reactnative.keepalive.StreamCallKeepAliveHeadlessService"
9
- android:exported="false"
10
- android:stopWithTask="true"
11
- android:foregroundServiceType="mediaPlayback|camera|microphone" />
12
- </application>
13
2
  </manifest>
@@ -15,7 +15,6 @@ import android.os.Build
15
15
  import android.os.PowerManager
16
16
  import android.util.Base64
17
17
  import android.util.Log
18
- import androidx.core.content.ContextCompat
19
18
  import com.facebook.react.bridge.Arguments
20
19
  import com.facebook.react.bridge.Promise
21
20
  import com.facebook.react.bridge.ReactApplicationContext
@@ -24,8 +23,8 @@ import com.facebook.react.bridge.ReactMethod
24
23
  import com.facebook.react.bridge.WritableMap
25
24
  import com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter
26
25
  import com.oney.WebRTCModule.WebRTCModule
27
- import com.streamvideo.reactnative.keepalive.StreamCallKeepAliveHeadlessService
28
26
  import com.streamvideo.reactnative.util.CallAlivePermissionsHelper
27
+ import com.streamvideo.reactnative.util.CallAliveServiceChecker
29
28
  import com.streamvideo.reactnative.util.PiPHelper
30
29
  import com.streamvideo.reactnative.util.RingtoneUtil
31
30
  import com.streamvideo.reactnative.util.YuvFrame
@@ -116,47 +115,11 @@ class StreamVideoReactNativeModule(reactContext: ReactApplicationContext) :
116
115
  promise.resolve(false)
117
116
  return
118
117
  }
119
- // Service is declared in the SDK's own AndroidManifest and merged by default.
120
- // Permissions are expected to be provided by the app (or via Expo config plugin).
121
- promise.resolve(true)
122
- }
123
-
124
-
125
- @ReactMethod
126
- fun startKeepCallAliveService(
127
- callCid: String,
128
- channelId: String,
129
- channelName: String,
130
- title: String,
131
- body: String,
132
- smallIconName: String?,
133
- promise: Promise
134
- ) {
135
- try {
136
- val intent = StreamCallKeepAliveHeadlessService.buildStartIntent(
137
- reactApplicationContext,
138
- callCid,
139
- channelId,
140
- channelName,
141
- title,
142
- body,
143
- smallIconName
144
- )
145
- ContextCompat.startForegroundService(reactApplicationContext, intent)
118
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
119
+ val isForegroundServiceDeclared = CallAliveServiceChecker.isForegroundServiceDeclared(reactApplicationContext)
120
+ promise.resolve(isForegroundServiceDeclared)
121
+ } else {
146
122
  promise.resolve(true)
147
- } catch (e: Exception) {
148
- promise.reject(NAME, "Failed to start keep call alive foreground service", e)
149
- }
150
- }
151
-
152
- @ReactMethod
153
- fun stopKeepCallAliveService(promise: Promise) {
154
- try {
155
- val intent = StreamCallKeepAliveHeadlessService.buildStopIntent(reactApplicationContext)
156
- val stopped = reactApplicationContext.stopService(intent)
157
- promise.resolve(stopped)
158
- } catch (e: Exception) {
159
- promise.reject(NAME, "Failed to stop keep call alive foreground service", e)
160
123
  }
161
124
  }
162
125
 
@@ -55,78 +55,14 @@ object WebRtcAudioUtils {
55
55
  * what might be the root cause.
56
56
  */
57
57
  fun logAudioState(tag: String, reactContext: ReactContext) {
58
- Log.d(tag, getAudioStateLog(reactContext))
59
- }
60
-
61
- /**
62
- * Returns a string containing information about the current audio state.
63
- * Similar to logAudioState but returns the information instead of logging it.
64
- */
65
- fun getAudioStateLog(reactContext: ReactContext): String {
66
- val audioManager = reactContext.getSystemService(Context.AUDIO_SERVICE) as AudioManager
67
- val sb = StringBuilder()
68
-
69
- // Volume control stream
70
58
  reactContext.currentActivity?.let {
71
- sb.appendLine("volumeControlStream: ${streamTypeToString(it.volumeControlStream)}")
59
+ Log.d(tag, "volumeControlStream: " + streamTypeToString(it.volumeControlStream))
72
60
  }
73
-
74
- // Device info
75
- sb.appendLine("Android SDK: ${Build.VERSION.SDK_INT}, Release: ${Build.VERSION.RELEASE}, Brand: ${Build.BRAND}, Device: ${Build.DEVICE}, Id: ${Build.ID}, Hardware: ${Build.HARDWARE}, Manufacturer: ${Build.MANUFACTURER}, Model: ${Build.MODEL}, Product: ${Build.PRODUCT}")
76
-
77
- // Basic audio state
78
- sb.appendLine("Audio State: audio mode: ${modeToString(audioManager.mode)}, has mic: ${hasMicrophone(reactContext)}, mic muted: ${audioManager.isMicrophoneMute}, music active: ${audioManager.isMusicActive}, speakerphone: ${audioManager.isSpeakerphoneOn}, BT SCO: ${audioManager.isBluetoothScoOn}")
79
-
80
- // Volume info
81
- val fixedVolume = audioManager.isVolumeFixed
82
- sb.appendLine(" fixed volume=$fixedVolume")
83
- if (!fixedVolume) {
84
- val streams = intArrayOf(
85
- AudioManager.STREAM_VOICE_CALL,
86
- AudioManager.STREAM_MUSIC,
87
- AudioManager.STREAM_RING,
88
- AudioManager.STREAM_ALARM,
89
- AudioManager.STREAM_NOTIFICATION,
90
- AudioManager.STREAM_SYSTEM
91
- )
92
- for (stream in streams) {
93
- val info = StringBuilder()
94
- info.append(" ${streamTypeToString(stream)}: ")
95
- info.append("volume=${audioManager.getStreamVolume(stream)}")
96
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
97
- info.append(", min=${audioManager.getStreamMinVolume(stream)}")
98
- }
99
- info.append(", max=${audioManager.getStreamMaxVolume(stream)}")
100
- info.append(", muted=${audioManager.isStreamMute(stream)}")
101
- sb.appendLine(info.toString())
102
- }
103
- }
104
-
105
- // Audio devices
106
- val inputDevices = audioManager.getDevices(AudioManager.GET_DEVICES_INPUTS)
107
- val outputDevices = audioManager.getDevices(AudioManager.GET_DEVICES_OUTPUTS)
108
- val devices = inputDevices + outputDevices
109
- if (devices.isNotEmpty()) {
110
- sb.appendLine("Audio Devices:")
111
- for (device in devices) {
112
- val info = StringBuilder()
113
- info.append(" ${deviceTypeToString(device.type)}")
114
- info.append(if (device.isSource) "(in): " else "(out): ")
115
- if (device.channelCounts.isNotEmpty()) {
116
- info.append("channels=${device.channelCounts.contentToString()}, ")
117
- }
118
- if (device.encodings.isNotEmpty()) {
119
- info.append("encodings=${device.encodings.contentToString()}, ")
120
- }
121
- if (device.sampleRates.isNotEmpty()) {
122
- info.append("sample rates=${device.sampleRates.contentToString()}, ")
123
- }
124
- info.append("id=${device.id}")
125
- sb.appendLine(info.toString())
126
- }
127
- }
128
-
129
- return sb.toString()
61
+ val audioManager = reactContext.getSystemService(Context.AUDIO_SERVICE) as AudioManager
62
+ logDeviceInfo(tag)
63
+ logAudioStateBasic(tag, reactContext, audioManager)
64
+ logAudioStateVolume(tag, audioManager)
65
+ logAudioDeviceInfo(tag, audioManager)
130
66
  }
131
67
 
132
68
  /** Converts AudioDeviceInfo types to local string representation. */
@@ -168,12 +168,10 @@ class StreamInCallManagerModule(reactContext: ReactApplicationContext) :
168
168
 
169
169
  @ReactMethod
170
170
  fun logAudioState() {
171
- Log.d(TAG, getAudioStateLog())
172
- }
173
-
174
- @ReactMethod(isBlockingSynchronousMethod = true)
175
- fun getAudioStateLog(): String {
176
- return WebRtcAudioUtils.getAudioStateLog(reactApplicationContext)
171
+ WebRtcAudioUtils.logAudioState(
172
+ TAG,
173
+ reactApplicationContext,
174
+ )
177
175
  }
178
176
 
179
177
  @Suppress("unused")
@@ -0,0 +1,95 @@
1
+ package com.streamvideo.reactnative.util
2
+
3
+ import android.content.ComponentName
4
+ import android.content.pm.PackageManager
5
+ import android.content.pm.ServiceInfo
6
+ import android.os.Build
7
+ import android.util.Log
8
+ import androidx.annotation.RequiresApi
9
+ import com.facebook.react.bridge.ReactApplicationContext
10
+
11
+ @RequiresApi(api = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
12
+ object CallAliveServiceChecker {
13
+ private const val NAME = "StreamVideoReactNative"
14
+
15
+ fun isForegroundServiceDeclared(context: ReactApplicationContext): Boolean {
16
+ val packageManager = context.packageManager
17
+ val packageName = context.packageName // Get the package name of your app
18
+ val componentName = ComponentName(
19
+ packageName,
20
+ "app.notifee.core.ForegroundService"
21
+ ) // Use service name string
22
+
23
+ try {
24
+ val serviceInfo =
25
+ packageManager.getServiceInfo(componentName, PackageManager.GET_META_DATA)
26
+
27
+ val expectedForegroundServiceTypes =
28
+ ServiceInfo.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE or
29
+ ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK or
30
+ ServiceInfo.FOREGROUND_SERVICE_TYPE_CAMERA or
31
+ ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE
32
+
33
+ val actualForegroundServiceTypes = serviceInfo.foregroundServiceType
34
+
35
+ if (actualForegroundServiceTypes == expectedForegroundServiceTypes) {
36
+ return true
37
+ } else {
38
+ Log.w(
39
+ NAME,
40
+ "android:foregroundServiceType does not match: expected=${
41
+ foregroundServiceTypeToString(
42
+ expectedForegroundServiceTypes
43
+ )
44
+ }, actual=${foregroundServiceTypeToString(actualForegroundServiceTypes)}"
45
+ )
46
+ return false
47
+ }
48
+
49
+ } catch (e: PackageManager.NameNotFoundException) {
50
+ Log.d(NAME, "Service not found: " + e.message)
51
+ return false // Service not declared
52
+ }
53
+ }
54
+
55
+ private fun foregroundServiceTypeToString(foregroundServiceType: Int): String {
56
+ val types = mutableListOf<String>()
57
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE != 0) {
58
+ types.add("shortService")
59
+ }
60
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC != 0) {
61
+ types.add("dataSync")
62
+ }
63
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_CAMERA != 0) {
64
+ types.add("camera")
65
+ }
66
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE != 0) {
67
+ types.add("microphone")
68
+ }
69
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE != 0) {
70
+ types.add("connectedDevice")
71
+ }
72
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_LOCATION != 0) {
73
+ types.add("location")
74
+ }
75
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK != 0) {
76
+ types.add("mediaPlayback")
77
+ }
78
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION != 0) {
79
+ types.add("mediaProjection")
80
+ }
81
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_PHONE_CALL != 0) {
82
+ types.add("phoneCall")
83
+ }
84
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_HEALTH != 0) {
85
+ types.add("health")
86
+ }
87
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_REMOTE_MESSAGING != 0) {
88
+ types.add("remoteMessaging")
89
+ }
90
+ if (foregroundServiceType and ServiceInfo.FOREGROUND_SERVICE_TYPE_SYSTEM_EXEMPTED != 0) {
91
+ types.add("systemExempted")
92
+ }
93
+ return types.joinToString("|")
94
+ }
95
+ }
@@ -0,0 +1,160 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useIosCallkeepWithCallingStateEffect = void 0;
7
+ var _videoClient = require("@stream-io/video-client");
8
+ var _videoReactBindings = require("@stream-io/video-react-bindings");
9
+ var _reactNative = require("react-native");
10
+ var _react = require("react");
11
+ var _utils = require("../../utils");
12
+ var _libs = require("../../utils/push/libs");
13
+ var _rxSubjects = require("../../utils/push/internal/rxSubjects");
14
+ const isNonActiveCallingState = callingState => {
15
+ return callingState === _videoClient.CallingState.IDLE || callingState === _videoClient.CallingState.UNKNOWN || callingState === _videoClient.CallingState.LEFT;
16
+ };
17
+ const isAcceptedCallingState = callingState => {
18
+ return callingState === _videoClient.CallingState.JOINING || callingState === _videoClient.CallingState.JOINED;
19
+ };
20
+ const unsubscribeCallkeepEvents = async activeCallCid => {
21
+ const voipPushNotificationCallCId = _videoClient.RxUtils.getCurrentValue(_rxSubjects.voipPushNotificationCallCId$);
22
+ if (activeCallCid && activeCallCid === voipPushNotificationCallCId) {
23
+ // callkeep events should not be listened anymore so clear the call cid
24
+ _rxSubjects.voipPushNotificationCallCId$.next(undefined);
25
+ }
26
+ return await _reactNative.NativeModules.StreamVideoReactNative?.removeIncomingCall(activeCallCid);
27
+ };
28
+ const logger = _videoClient.videoLoggerSystem.getLogger('useIosCallkeepWithCallingStateEffect');
29
+ const log = message => {
30
+ logger.warn(message);
31
+ };
32
+
33
+ /**
34
+ * This hook is used to inform the callkeep library that the call has been joined or ended.
35
+ */
36
+ const useIosCallkeepWithCallingStateEffect = () => {
37
+ const activeCall = (0, _videoReactBindings.useCall)();
38
+ const {
39
+ useCallCallingState
40
+ } = (0, _videoReactBindings.useCallStateHooks)();
41
+ const callingState = useCallCallingState();
42
+ const [acceptedForegroundCallkeepMap, setAcceptedForegroundCallkeepMap] = (0, _react.useState)();
43
+ (0, _react.useEffect)(() => {
44
+ return () => {
45
+ const pushConfig = _utils.StreamVideoRN.getConfig().push;
46
+ if (_reactNative.Platform.OS !== 'ios' || !pushConfig || !pushConfig.ios?.pushProviderName) {
47
+ return;
48
+ }
49
+ if (!pushConfig.android.incomingCallChannel) {
50
+ // TODO: remove this check and find a better way once we have telecom integration for android
51
+ return;
52
+ }
53
+ const callkeep = (0, _libs.getCallKeepLib)();
54
+ // if the component is unmounted and the callID was not reported to callkeep, then report it now
55
+ if (acceptedForegroundCallkeepMap) {
56
+ log(`Ending call in callkeep: ${acceptedForegroundCallkeepMap.cid}, reason: component unmounted and call was present in acceptedForegroundCallkeepMap`);
57
+ unsubscribeCallkeepEvents(acceptedForegroundCallkeepMap.cid).then(() => callkeep.endCall(acceptedForegroundCallkeepMap.uuid));
58
+ }
59
+ };
60
+ }, [acceptedForegroundCallkeepMap]);
61
+ const activeCallCid = activeCall?.cid;
62
+ (0, _react.useEffect)(() => {
63
+ return () => {
64
+ const pushConfig = _utils.StreamVideoRN.getConfig().push;
65
+ if (_reactNative.Platform.OS !== 'ios' || !pushConfig || !pushConfig.ios?.pushProviderName || !activeCallCid) {
66
+ return;
67
+ }
68
+ if (!pushConfig.android.incomingCallChannel) {
69
+ // TODO: remove this check and find a better way once we have telecom integration for android
70
+ return;
71
+ }
72
+ const nativeDialerAcceptedCallMap = _videoClient.RxUtils.getCurrentValue(_rxSubjects.voipCallkeepAcceptedCallOnNativeDialerMap$);
73
+ const foregroundIncomingCallkeepMap = _videoClient.RxUtils.getCurrentValue(_rxSubjects.voipCallkeepCallOnForegroundMap$);
74
+ const callkeep = (0, _libs.getCallKeepLib)();
75
+ if (activeCallCid === nativeDialerAcceptedCallMap?.cid) {
76
+ log(`Ending call in callkeep: ${activeCallCid}, reason: activeCallCid changed or was removed and call was present in nativeDialerAcceptedCallMap`);
77
+ unsubscribeCallkeepEvents(activeCallCid).then(() => callkeep.endCall(nativeDialerAcceptedCallMap.uuid));
78
+ // no need to keep this reference anymore
79
+ _rxSubjects.voipCallkeepAcceptedCallOnNativeDialerMap$.next(undefined);
80
+ } else if (activeCallCid === foregroundIncomingCallkeepMap?.cid) {
81
+ log(`Ending call in callkeep: ${activeCallCid}, reason: activeCallCid changed or was removed and call was present in foregroundIncomingCallkeepMap`);
82
+ unsubscribeCallkeepEvents(activeCallCid).then(() => callkeep.endCall(foregroundIncomingCallkeepMap.uuid));
83
+ }
84
+ };
85
+ }, [activeCallCid]);
86
+ const pushConfig = _utils.StreamVideoRN.getConfig().push;
87
+ if (_reactNative.Platform.OS !== 'ios' || !pushConfig || !pushConfig.ios.pushProviderName || !activeCallCid) {
88
+ return;
89
+ }
90
+ if (!pushConfig.android.incomingCallChannel) {
91
+ // TODO: remove this check and find a better way once we have telecom integration for android
92
+ return;
93
+ }
94
+
95
+ /**
96
+ * Check if current call is still needed to be accepted in callkeep
97
+ */
98
+ if (isAcceptedCallingState(callingState) && acceptedForegroundCallkeepMap?.cid !== activeCallCid) {
99
+ const callkeep = (0, _libs.getCallKeepLib)();
100
+ // push notification was displayed
101
+ // but the call has been accepted through the app and not through the native dialer
102
+ const foregroundCallkeepMap = _videoClient.RxUtils.getCurrentValue(_rxSubjects.voipCallkeepCallOnForegroundMap$);
103
+ if (foregroundCallkeepMap && foregroundCallkeepMap.cid === activeCallCid) {
104
+ log(
105
+ // @ts-expect-error - types issue
106
+ `Accepting call in callkeep: ${activeCallCid}, reason: callingstate went to ${_videoClient.CallingState[callingState]} and call was present in foregroundCallkeepMap`);
107
+ // no need to keep this reference anymore
108
+ _rxSubjects.voipCallkeepCallOnForegroundMap$.next(undefined);
109
+ _reactNative.NativeModules.StreamVideoReactNative?.removeIncomingCall(activeCallCid).then(() => callkeep.answerIncomingCall(foregroundCallkeepMap.uuid));
110
+ // this call should be accepted in callkeep
111
+ setAcceptedForegroundCallkeepMap(foregroundCallkeepMap);
112
+ }
113
+ }
114
+
115
+ /**
116
+ * Check if current call is still needed to be ended in callkeep
117
+ */
118
+ if (isNonActiveCallingState(callingState)) {
119
+ const callkeep = (0, _libs.getCallKeepLib)();
120
+
121
+ // this was a previously joined call which had push notification displayed
122
+ // the call was accepted through the app and not through native dialer
123
+ // the call was left using the leave button in the app and not through native dialer
124
+ if (activeCallCid === acceptedForegroundCallkeepMap?.cid) {
125
+ log(
126
+ // @ts-expect-error - types issue
127
+ `Ending call in callkeep: ${activeCallCid}, reason: callingstate went to ${_videoClient.CallingState[callingState]} and call was present in acceptedForegroundCallkeepMap`);
128
+ unsubscribeCallkeepEvents(activeCallCid).then(() => callkeep.endCall(acceptedForegroundCallkeepMap.uuid));
129
+ setAcceptedForegroundCallkeepMap(undefined);
130
+ return;
131
+ }
132
+ // this was a call which had push notification displayed but never joined
133
+ // the user rejected in the app and not from native dialer
134
+ const foregroundIncomingCallkeepMap = _videoClient.RxUtils.getCurrentValue(_rxSubjects.voipCallkeepCallOnForegroundMap$);
135
+ if (activeCallCid === foregroundIncomingCallkeepMap?.cid) {
136
+ log(
137
+ // @ts-expect-error - types issue
138
+ `Ending call in callkeep: ${activeCallCid}, reason: callingstate went to ${_videoClient.CallingState[callingState]} and call was present in foregroundIncomingCallkeepMap`);
139
+ unsubscribeCallkeepEvents(activeCallCid).then(() => callkeep.endCall(foregroundIncomingCallkeepMap.uuid));
140
+ // no need to keep this reference anymore
141
+ _rxSubjects.voipCallkeepCallOnForegroundMap$.next(undefined);
142
+ return;
143
+ }
144
+ // this was a previously joined call
145
+ // it was an accepted call from native dialer and not from the app
146
+ // the user left using the leave button in the app
147
+ const nativeDialerAcceptedCallMap = _videoClient.RxUtils.getCurrentValue(_rxSubjects.voipCallkeepAcceptedCallOnNativeDialerMap$);
148
+ if (activeCallCid === nativeDialerAcceptedCallMap?.cid) {
149
+ log(
150
+ // @ts-expect-error - types issue
151
+ `Ending call in callkeep: ${activeCallCid}, reason: callingstate went to ${_videoClient.CallingState[callingState]} and call was present in nativeDialerAcceptedCallMap`);
152
+ unsubscribeCallkeepEvents(activeCallCid).then(() => callkeep.endCall(nativeDialerAcceptedCallMap.uuid));
153
+ // no need to keep this reference anymore
154
+ _rxSubjects.voipCallkeepAcceptedCallOnNativeDialerMap$.next(undefined);
155
+ return;
156
+ }
157
+ }
158
+ };
159
+ exports.useIosCallkeepWithCallingStateEffect = useIosCallkeepWithCallingStateEffect;
160
+ //# sourceMappingURL=useIosCallkeepWithCallingStateEffect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_videoClient","require","_videoReactBindings","_reactNative","_react","_utils","_libs","_rxSubjects","isNonActiveCallingState","callingState","CallingState","IDLE","UNKNOWN","LEFT","isAcceptedCallingState","JOINING","JOINED","unsubscribeCallkeepEvents","activeCallCid","voipPushNotificationCallCId","RxUtils","getCurrentValue","voipPushNotificationCallCId$","next","undefined","NativeModules","StreamVideoReactNative","removeIncomingCall","logger","videoLoggerSystem","getLogger","log","message","warn","useIosCallkeepWithCallingStateEffect","activeCall","useCall","useCallCallingState","useCallStateHooks","acceptedForegroundCallkeepMap","setAcceptedForegroundCallkeepMap","useState","useEffect","pushConfig","StreamVideoRN","getConfig","push","Platform","OS","ios","pushProviderName","android","incomingCallChannel","callkeep","getCallKeepLib","cid","then","endCall","uuid","nativeDialerAcceptedCallMap","voipCallkeepAcceptedCallOnNativeDialerMap$","foregroundIncomingCallkeepMap","voipCallkeepCallOnForegroundMap$","foregroundCallkeepMap","answerIncomingCall","exports"],"sourceRoot":"../../../../src","sources":["hooks/push/useIosCallkeepWithCallingStateEffect.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAMA,MAAMO,uBAAuB,GAAIC,YAA0B,IAAK;EAC9D,OACEA,YAAY,KAAKC,yBAAY,CAACC,IAAI,IAClCF,YAAY,KAAKC,yBAAY,CAACE,OAAO,IACrCH,YAAY,KAAKC,yBAAY,CAACG,IAAI;AAEtC,CAAC;AAED,MAAMC,sBAAsB,GAAIL,YAA0B,IAAK;EAC7D,OACEA,YAAY,KAAKC,yBAAY,CAACK,OAAO,IACrCN,YAAY,KAAKC,yBAAY,CAACM,MAAM;AAExC,CAAC;AAED,MAAMC,yBAAyB,GAAG,MAAOC,aAAiC,IAAK;EAC7E,MAAMC,2BAA2B,GAAGC,oBAAO,CAACC,eAAe,CACzDC,wCACF,CAAC;EACD,IAAIJ,aAAa,IAAIA,aAAa,KAAKC,2BAA2B,EAAE;IAClE;IACAG,wCAA4B,CAACC,IAAI,CAACC,SAAS,CAAC;EAC9C;EACA,OAAO,MAAMC,0BAAa,CAACC,sBAAsB,EAAEC,kBAAkB,CACnET,aACF,CAAC;AACH,CAAC;AAED,MAAMU,MAAM,GAAGC,8BAAiB,CAACC,SAAS,CACxC,sCACF,CAAC;AACD,MAAMC,GAAG,GAAIC,OAAe,IAAK;EAC/BJ,MAAM,CAACK,IAAI,CAACD,OAAO,CAAC;AACtB,CAAC;;AAED;AACA;AACA;AACO,MAAME,oCAAoC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,yBAAyB,CAACC,aAAa,CAAC,CAACsC,IAAI,CAAC,MAC5CH,QAAQ,CAACI,OAAO,CAACI,6BAA6B,CAACH,IAAI,CACrD,CAAC;MACD;MACAI,4CAAgC,CAACvC,IAAI,CAACC,SAAS,CAAC;MAChD;IACF;IACA;IACA;IACA;IACA,MAAMmC,2BAA2B,GAAGvC,oBAAO,CAACC,eAAe,CACzDuC,sDACF,CAAC;IACD,IAAI1C,aAAa,KAAKyC,2BAA2B,EAAEJ,GAAG,EAAE;MACtDxB,GAAG;MACD;MACA,4BAA4Bb,aAAa,kCAAkCR,yBAAY,CAACD,YAAY,CAAC,sDACvG,CAAC;MACDQ,yBAAyB,CAACC,aAAa,CAAC,CAACsC,IAAI,CAAC,MAC5CH,QAAQ,CAACI,OAAO,CAACE,2BAA2B,CAACD,IAAI,CACnD,CAAC;MACD;MACAE,sDAA0C,CAACrC,IAAI,CAACC,SAAS,CAAC;MAC1D;IACF;EACF;AACF,CAAC;AAACyC,OAAA,CAAA/B,oCAAA,GAAAA,oCAAA","ignoreList":[]}
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useIosVoipPushEventsSetupEffect = void 0;
7
7
  var _react = require("react");
8
+ var _libs = require("../../utils/push/libs");
8
9
  var _reactNative = require("react-native");
9
10
  var _utils = require("../../utils");
10
11
  var _ios = require("../../utils/push/internal/ios");
11
12
  var _videoReactBindings = require("@stream-io/video-react-bindings");
12
13
  var _pushLogoutCallback = require("../../utils/internal/pushLogoutCallback");
13
14
  var _videoClient = require("@stream-io/video-client");
14
- var _libs = require("../../utils/push/libs");
15
15
  const logger = _videoClient.videoLoggerSystem.getLogger('useIosVoipPushEventsSetupEffect');
16
16
 
17
17
  /* VoipPushNotificationLib has support for only one listener type at a time
@@ -29,7 +29,6 @@ function setLogoutCallback(client, token, lastVoipTokenRef) {
29
29
  };
30
30
  try {
31
31
  await client.removeDevice(token);
32
- logger.debug('PushLogoutCallback - Removed voip token', token);
33
32
  } catch (err) {
34
33
  logger.warn('PushLogoutCallback - Failed to remove voip token', err);
35
34
  }
@@ -84,10 +83,20 @@ const useIosVoipPushEventsSetupEffect = () => {
84
83
  (0, _react.useEffect)(() => {
85
84
  const pushConfig = _utils.StreamVideoRN.getConfig().push;
86
85
  const pushProviderName = pushConfig?.ios.pushProviderName;
87
- const callingx = (0, _libs.getCallingxLibIfAvailable)();
88
- if (_reactNative.Platform.OS !== 'ios' || !client || !pushProviderName || !callingx) {
86
+ if (_reactNative.Platform.OS !== 'ios' || !client || !pushProviderName) {
87
+ return;
88
+ }
89
+ if (!pushConfig.android.incomingCallChannel) {
90
+ // TODO: remove this check and find a better way once we have telecom integration for android
91
+ logger.debug('android incomingCallChannel is not defined, so skipping the useIosVoipPushEventsSetupEffect');
89
92
  return;
90
93
  }
94
+ const voipPushNotification = (0, _libs.getVoipPushNotificationLib)();
95
+
96
+ // even though we do this natively, we have to still register here again
97
+ // natively this will make sure "register" event for JS is sent with the last push token
98
+ // Necessary if client changed before we got the event here or user logged out and logged in again
99
+ voipPushNotification.registerVoipToken();
91
100
  const onTokenReceived = token => {
92
101
  const userId = client.streamClient._user?.id ?? '';
93
102
  if (client.streamClient.anonymous || !token || !userId) {
@@ -115,24 +124,27 @@ const useIosVoipPushEventsSetupEffect = () => {
115
124
  });
116
125
  };
117
126
  // fired when PushKit give us the latest token
118
- const voipRegisterListener = callingx.addEventListener('voipNotificationsRegistered', ({
119
- token
120
- }) => {
127
+ voipPushNotification.addEventListener('register', token => {
121
128
  onTokenReceived(token);
122
129
  });
123
130
 
124
- // this will return events that were fired before js bridge initialized
125
- callingx.getInitialVoipEvents().forEach(({
126
- eventName,
127
- params
128
- }) => {
129
- if (eventName === 'voipNotificationsRegistered' && 'token' in params) {
130
- onTokenReceived(params.token);
131
- } else if (eventName === 'voipNotificationReceived') {
132
- (0, _ios.onVoipNotificationReceived)(params, pushConfig);
131
+ // this will fire when there are events occured before js bridge initialized
132
+ voipPushNotification.addEventListener('didLoadWithEvents', events => {
133
+ if (!events || !Array.isArray(events) || events.length < 1) {
134
+ return;
135
+ }
136
+ for (const voipPushEvent of events) {
137
+ const {
138
+ name,
139
+ data
140
+ } = voipPushEvent;
141
+ if (name === 'RNVoipPushRemoteNotificationsRegisteredEvent') {
142
+ onTokenReceived(data);
143
+ } else if (name === 'RNVoipPushRemoteNotificationReceivedEvent') {
144
+ (0, _ios.onVoipNotificationReceived)(data, pushConfig);
145
+ }
133
146
  }
134
147
  });
135
- callingx.registerVoipToken();
136
148
  lastListener.count += 1;
137
149
  const currentListenerCount = lastListener.count;
138
150
  return () => {
@@ -142,7 +154,8 @@ const useIosVoipPushEventsSetupEffect = () => {
142
154
  return;
143
155
  }
144
156
  logger.debug(`Voip event listeners are removed for user: ${userId}`);
145
- voipRegisterListener.remove();
157
+ voipPushNotification.removeEventListener('didLoadWithEvents');
158
+ voipPushNotification.removeEventListener('register');
146
159
  };
147
160
  }, [client]);
148
161
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_reactNative","_utils","_ios","_videoReactBindings","_pushLogoutCallback","_videoClient","_libs","logger","videoLoggerSystem","getLogger","lastListener","count","setLogoutCallback","client","token","lastVoipTokenRef","setPushLogoutCallback","current","userId","removeDevice","debug","err","warn","useIosVoipPushEventsSetupEffect","useStreamVideoClient","connectedUserId","useConnectedUser","id","useRef","unsentToken","setUnsentToken","useState","useEffect","pushProviderName","StreamVideoRN","getConfig","push","ios","tokenToSend","addVoipDevice","then","undefined","catch","error","pushConfig","callingx","getCallingxLibIfAvailable","Platform","OS","onTokenReceived","streamClient","_user","anonymous","reason","lastVoipToken","voipRegisterListener","addEventListener","getInitialVoipEvents","forEach","eventName","params","onVoipNotificationReceived","registerVoipToken","currentListenerCount","remove","exports"],"sourceRoot":"../../../../src","sources":["hooks/push/useIosVoipPushEventsSetupEffect.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IA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e,IAAI,CACT,8BAA8BR,KAAK,YAAYI,MAAM,EAAE,EACvDG,GACF,CAAC;MACH,CAAC,CAAC;IACN,CAAC;IACD;IACA,MAAMkC,oBAAoB,GAAGV,QAAQ,CAACW,gBAAgB,CACpD,6BAA6B,EAC7B,CAAC;MAAE1C;IAAM,CAAC,KAAK;MACbmC,eAAe,CAACnC,KAAK,CAAC;IACxB,CACF,CAAC;;IAED;IACA+B,QAAQ,CAACY,oBAAoB,CAAC,CAAC,CAACC,OAAO,CAAC,CAAC;MAAEC,SAAS;MAAEC;IAAO,CAAC,KAAK;MACjE,IAAID,SAAS,KAAK,6BAA6B,IAAI,OAAO,IAAIC,MAAM,EAAE;QACpEX,eAAe,CAACW,MAAM,CAAC9C,KAAK,CAAC;MAC/B,CAAC,MAAM,IAAI6C,SAAS,KAAK,0BAA0B,EAAE;QACnD,IAAAE,+BAA0B,EAACD,MAAM,EAAEhB,UAAU,CAAC;MAChD;IACF,CAAC,CAAC;IAEFC,QAAQ,CAACiB,iBAAiB,CAAC,CAAC;IAE5BpD,YAAY,CAACC,KAAK,IAAI,CAAC;IACvB,MAAMoD,oBAAoB,GAAGrD,YAAY,CAACC,KAAK;IAE/C,OAAO,MAAM;MACX,MAAMO,MAAM,GAAGL,MAAM,CAACqC,YAAY,CAACC,KAAK,EAAExB,EAAE;MAC5C,IAAIoC,oBAAoB,KAAKrD,YAAY,CAACC,KAAK,EAAE;QAC/CJ,MAAM,CAACa,KAAK,CACV,mDAAmDF,MAAM,EAC3D,CAAC;QACD;MACF;MACAX,MAAM,CAACa,KAAK,CAAC,8CAA8CF,MAAM,EAAE,CAAC;MACpEqC,oBAAoB,CAACS,MAAM,CAAC,CAAC;IAC/B,CAAC;EACH,CAAC,EAAE,CAACnD,MAAM,CAAC,CAAC;AACd,CAAC;AAACoD,OAAA,CAAA1C,+BAAA,GAAAA,+BAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","_libs","_reactNative","_utils","_ios","_videoReactBindings","_pushLogoutCallback","_videoClient","logger","videoLoggerSystem","getLogger","lastListener","count","setLogoutCallback","client","token","lastVoipTokenRef","setPushLogoutCallback","current","userId","removeDevice","err","warn","useIosVoipPushEventsSetupEffect","useStreamVideoClient","connectedUserId","useConnectedUser","id","useRef","unsentToken","setUnsentToken","useState","useEffect","pushProviderName","StreamVideoRN","getConfig","push","ios","tokenToSend","debug","addVoipDevice","then","undefined","catch","error","pushConfig","Platform","OS","android","incomingCallChannel","voipPushNotification","getVoipPushNotificationLib","registerVoipToken","onTokenReceived","streamClient","_user","anonymous","reason","lastVoipToken","addEventListener","events","Array","isArray","length","voipPushEvent","name","data","onVoipNotificationReceived","currentListenerCount","removeEventListener","exports"],"sourceRoot":"../../../../src","sources":["hooks/push/useIosVoipPushEventsSetupEffect.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AAIA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAEA,MAAMQ,MAAM,GAAGC,8BAAiB,CAACC,SAAS,CAAC,iCAAiC,CAAC;;AAE7E;AACA;AACA;AACA;AACA,MAAMC,YAAY,GAAG;EAAEC,KAAK,EAAE;AAAE,CAAC;AAEjC,SAASC,iBAAiBA,CACxBC,MAAyB,EACzBC,KAAa,EACbC,gBAAqE,EACrE;EACA,IAAAC,yCAAqB,EAAC,YAAY;IAChCD,gBAAgB,CAACE,OAAO,GAAG;MAAEH,KAAK,EAAE,EAAE;MAAEI,MAAM,EAAE;IAAG,CAAC;IACpD,IAAI;MACF,MAAML,MAAM,CAACM,YAAY,CAACL,KAAK,CAAC;IAClC,CAAC,CAAC,OAAOM,GAAG,EAAE;MACZb,MAAM,CAACc,IAAI,CAAC,kDAAk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