@kaleyra/video-react-native-module 1.6.0 → 2.0.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 (113) hide show
  1. package/README.md +17 -47
  2. package/android/build.gradle +24 -32
  3. package/android/gradle.properties +3 -3
  4. package/android/settings.gradle +0 -5
  5. package/android/src/main/AndroidManifest.xml +1 -1
  6. package/android/src/main/assets/kaleyra_video_wrapper_info.txt +1 -1
  7. package/android/src/main/java/com/kaleyra/video_react_native_module/VideoNativeModule.kt +0 -9
  8. package/index.ts +0 -2
  9. package/ios/PluginInfo/_KaleyraVideoHybridVersionInfo.swift +1 -1
  10. package/ios/VideoNativeModule.m +0 -6
  11. package/ios/VideoNativeModule.swift +1 -20
  12. package/lib/commonjs/src/KaleyraVideo.js +0 -34
  13. package/lib/module/src/KaleyraVideo.js +0 -34
  14. package/lib/typescript/index.d.ts +2 -2
  15. package/lib/typescript/native-bridge/TypeScript/types/UserDetails.d.ts +3 -15
  16. package/lib/typescript/src/KaleyraVideo.d.ts +1 -16
  17. package/native-bridge/TypeScript/types/UserDetails.ts +3 -18
  18. package/native-bridge/android/bridge.gradle +71 -0
  19. package/native-bridge/android/build.gradle +5 -61
  20. package/native-bridge/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  21. package/native-bridge/android/settings.gradle +8 -0
  22. package/native-bridge/android/src/main/AndroidManifest.xml +1 -1
  23. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/DTOs.kt +6 -40
  24. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/SDKAccessTokenProviderProxy.kt +9 -7
  25. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/VideoHybridBridge.kt +0 -2
  26. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/VideoSDKHybridBridge.kt +13 -23
  27. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/configurator/VideoSDKConfigurator.kt +11 -5
  28. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/connector/VideoSDKCachedUserConnector.kt +7 -5
  29. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/reporter/CallEventsReporter.kt +27 -35
  30. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/reporter/ChatEventsReporter.kt +34 -24
  31. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/reporter/CrossPlatformModuleStatus.kt +14 -15
  32. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/reporter/ModuleEventsReporter.kt +40 -18
  33. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/reporter/SDKEventsReporter.kt +6 -6
  34. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/CallDisplayExtension.kt +4 -3
  35. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/CallTypeExtensions.kt +12 -0
  36. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/ConfigurationExtension.kt +17 -23
  37. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/EnvironmentExtension.kt +3 -3
  38. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/RecordingTypeExtension.kt +5 -7
  39. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/RegionExtension.kt +4 -4
  40. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/ScreenShareToolConfigurationExtension.kt +5 -6
  41. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/ToolsExtension.kt +49 -81
  42. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/UserExtensions.kt +24 -17
  43. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/notifications/KaleyraVideoNotificationService.kt +1 -2
  44. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/repository/UserDetailsDao.kt +1 -1
  45. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/repository/UserDetailsEntity.kt +2 -6
  46. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/repository/VideoHybridBridgeRepository.kt +1 -1
  47. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/ui/SDKUserInterfacePresenter.kt +22 -20
  48. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/user_details/CachedUserDetails.kt +0 -3
  49. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/user_details/SDKCachedUserDetails.kt +22 -30
  50. package/native-bridge/iOS/KaleyraVideoHybridNativeBridge.xcodeproj/project.pbxproj +84 -132
  51. package/native-bridge/iOS/Podfile +2 -2
  52. package/native-bridge/iOS/Podfile.lock +9 -9
  53. package/native-bridge/iOS/Source/Abstractions/CallWindowProtocol.swift +3 -6
  54. package/native-bridge/iOS/Source/Abstractions/KaleyraVideoSDKProtocol.swift +20 -0
  55. package/native-bridge/iOS/Source/AccessToken/AccessTokenRequester.swift +0 -1
  56. package/native-bridge/iOS/Source/AccessToken/TokenProvider.swift +1 -2
  57. package/native-bridge/iOS/Source/Broadcast/BroadcastConfigurationPlistReader.swift +0 -1
  58. package/native-bridge/iOS/Source/Concurrency/DispatchQueue+isMain.swift +0 -1
  59. package/native-bridge/iOS/Source/Concurrency/MainQueueDispatcher.swift +0 -1
  60. package/native-bridge/iOS/Source/Concurrency/MainQueueRelay.swift +0 -1
  61. package/native-bridge/iOS/Source/DTOs/AudioCallOptions+Equatable.swift +0 -1
  62. package/native-bridge/iOS/Source/DTOs/AudioCallOptions+KaleyraVideoSDK.swift +13 -0
  63. package/native-bridge/iOS/Source/DTOs/{AudioCallType+Bandyer.swift → AudioCallType+KaleyraVideoSDK.swift} +2 -3
  64. package/native-bridge/iOS/Source/DTOs/CallOptions+Equatable.swift +0 -1
  65. package/native-bridge/iOS/Source/DTOs/CallOptions+KaleyraVideoSDK.swift +12 -0
  66. package/native-bridge/iOS/Source/DTOs/{CallType+Bandyer.swift → CallType+KaleyraVideoSDK.swift} +2 -3
  67. package/native-bridge/iOS/Source/DTOs/CreateCallOptions+KaleyraVideoSDK.swift +12 -0
  68. package/native-bridge/iOS/Source/DTOs/DTOs.swift +3 -25
  69. package/native-bridge/iOS/Source/DTOs/{Environment+Bandyer.swift → Environment+KaleyraVideoSDK.swift} +2 -3
  70. package/native-bridge/iOS/Source/DTOs/KaleyraVideoConfiguration+KaleyraVideoSDK.swift +113 -0
  71. package/native-bridge/iOS/Source/DTOs/KaleyraVideoConfiguration+UserInterfacePresenterConfiguration.swift +0 -1
  72. package/native-bridge/iOS/Source/DTOs/RecordingType+KaleyraVideoSDK.swift +19 -0
  73. package/native-bridge/iOS/Source/DTOs/{Region+Bandyer.swift → Region+KaleyraVideoSDK.swift} +2 -3
  74. package/native-bridge/iOS/Source/DTOs/UserDetails+Decodable.swift +4 -10
  75. package/native-bridge/iOS/Source/DTOs/UserDetails+KaleyraVideoSDK.swift +15 -0
  76. package/native-bridge/iOS/Source/Events/Reporters/CallClientEventsReporter.swift +41 -16
  77. package/native-bridge/iOS/Source/Events/Reporters/ChatClientEventsReporter.swift +22 -17
  78. package/native-bridge/iOS/Source/Events/Reporters/ClientState.swift +14 -42
  79. package/native-bridge/iOS/Source/Events/Reporters/EventsReporter.swift +17 -13
  80. package/native-bridge/iOS/Source/Extensions/URL+FromString.swift +0 -2
  81. package/native-bridge/iOS/Source/NativeHybridBridge/VideoHybridNativeBridge.swift +14 -43
  82. package/native-bridge/iOS/Source/NativeHybridBridge/VideoHybridNativeBridgeError.swift +0 -1
  83. package/native-bridge/iOS/Source/UI/KaleyraVideoSDKUserInterfacePresenter.swift +68 -100
  84. package/native-bridge/iOS/Source/UI/Presenters/PresentingViewControllerViewControllerPresenter.swift +0 -1
  85. package/native-bridge/iOS/Source/UI/Presenters/ViewControllerPresenter.swift +0 -1
  86. package/native-bridge/iOS/Source/UI/Presenters/WindowViewControllerPresenter.swift +0 -1
  87. package/native-bridge/iOS/Source/UI/UserInterfacePresenter+MainQueueRelay.swift +0 -1
  88. package/native-bridge/iOS/Source/UI/UserInterfacePresenter.swift +0 -1
  89. package/native-bridge/iOS/Source/User Details/Cache/UsersDetailsCache.swift +6 -7
  90. package/native-bridge/iOS/Source/User Details/Providers/UsersDetailsProvider.swift +6 -19
  91. package/package.json +9 -7
  92. package/src/KaleyraVideo.ts +0 -42
  93. package/video-react-native-module.podspec +4 -4
  94. package/lib/commonjs/native-bridge/TypeScript/UserDetailsFormatValidator.js +0 -32
  95. package/lib/commonjs/native-bridge/TypeScript/types/UserDetailsFormat.js +0 -4
  96. package/lib/module/native-bridge/TypeScript/UserDetailsFormatValidator.js +0 -28
  97. package/lib/module/native-bridge/TypeScript/types/UserDetailsFormat.js +0 -3
  98. package/lib/typescript/native-bridge/TypeScript/UserDetailsFormatValidator.d.ts +0 -4
  99. package/lib/typescript/native-bridge/TypeScript/types/UserDetailsFormat.d.ts +0 -19
  100. package/native-bridge/TypeScript/UserDetailsFormatValidator.ts +0 -35
  101. package/native-bridge/TypeScript/types/UserDetailsFormat.ts +0 -23
  102. package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/user_details/CachedUserDetailsFormatter.kt +0 -59
  103. package/native-bridge/iOS/Source/Abstractions/BandyerSDKProtocol.swift +0 -25
  104. package/native-bridge/iOS/Source/DTOs/AudioCallOptions+Bandyer.swift +0 -14
  105. package/native-bridge/iOS/Source/DTOs/CallOptions+Bandyer.swift +0 -14
  106. package/native-bridge/iOS/Source/DTOs/CreateCallOptions+Intent.swift +0 -17
  107. package/native-bridge/iOS/Source/DTOs/KaleyraVideoConfiguration+Bandyer.swift +0 -158
  108. package/native-bridge/iOS/Source/DTOs/RecordingType+Bandyer.swift +0 -33
  109. package/native-bridge/iOS/Source/DTOs/UserDetails+Bandyer.swift +0 -18
  110. package/native-bridge/iOS/Source/DTOs/UserDetailsFormat+Decodable.swift +0 -19
  111. package/native-bridge/iOS/Source/Events/Reporters/PushTokenEventsReporter.swift +0 -34
  112. package/native-bridge/iOS/Source/User Details/Formatter/FormatterProxy.swift +0 -16
  113. package/native-bridge/iOS/Source/User Details/Formatter/UserDetailsFormatter.swift +0 -83
package/README.md CHANGED
@@ -8,11 +8,15 @@
8
8
 
9
9
  ```
10
10
  ruby = 2.7.6
11
- node >= v16
12
- react >= 0.71.x
11
+ node >= v18
12
+ react-native >= 0.74.x
13
13
  yarn >= 1.22.17
14
14
  ```
15
15
 
16
+ ## Minimum requirements
17
+ - Android 21+, gradle 8+, kotlin 1.9+
18
+ - iOS 15+, swift 5.x
19
+
16
20
  ## How to run the example
17
21
 
18
22
  Execute the following commands from the repository root folder
@@ -23,8 +27,10 @@ yarn prepack
23
27
  yarn link
24
28
  cd example
25
29
  # nano .env use your own keys
30
+ yarn
26
31
  yarn link @kaleyra/video-react-native-module
27
32
  yarn pods
33
+ yarn start
28
34
  yarn ios
29
35
  yarn android
30
36
  ```
@@ -210,6 +216,12 @@ kaleyraVideo.startCall({
210
216
  });
211
217
  ```
212
218
 
219
+ ##### Start call with URL
220
+
221
+ ```javascript
222
+ kaleyraVideo.startCallFrom("https://");
223
+ ```
224
+
213
225
  ## Start a chat
214
226
 
215
227
  To make a chat you need to specify some params.
@@ -227,8 +239,8 @@ This method will allow you to set your user details DB from which the sdk will r
227
239
 
228
240
  ```javascript
229
241
  kaleyraVideo.addUsersDetails([
230
- {userID: "usr_yyy", firstName: "User1Name", lastName: "User1Surname"},
231
- {userID: "usr_zzz", firstName: "User2Name", lastName: "User2Surname"},
242
+ {userID: "usr_yyy", name: "User1Name", imageUrl: "https://www.example.com/user1image.png"},
243
+ {userID: "usr_zzz", name: "User2Name", imageUrl: "https://www.example.com/user2image.png"},
232
244
  ]);
233
245
  ```
234
246
 
@@ -240,19 +252,6 @@ This method will allow you to remove all the user info from the local app DB.
240
252
  kaleyraVideo.removeUsersDetails();
241
253
  ```
242
254
 
243
- ## Set user details format
244
-
245
- This method will allow you to specify how you want your user details to be displayed.
246
- > Be aware that you can specify only keywords which exist in the UserDetails type.
247
-
248
- For example: if you wish to show only the firstName while your dataset contains also the lastName you may change it here.
249
-
250
- ```javascript
251
- kaleyraVideo.setUserDetailsFormat({
252
- default: "${firstName} ${lastName}",
253
- androidNotification: "${firstName} ${lastName}" // optional if you wish to personalize the details in the notification.
254
- });
255
- ```
256
255
 
257
256
  ## Remove all the cached info in preferences and DBs
258
257
 
@@ -269,14 +268,6 @@ For example: if you wish to show fingerprint dialog you should first put the cur
269
268
  kaleyraVideo.setDisplayModeForCurrentCall(CallDisplayMode.FOREGROUND); // FOREGROUND, FOREGROUND_PICTURE_IN_PICTURE or CallDisplayMode.BACKGROUND
270
269
  ```
271
270
 
272
- ## Verify user
273
-
274
- To verify a user for the current call.
275
-
276
- ```javascript
277
- kaleyraVideo.verifyCurrentCall(true);
278
- ```
279
-
280
271
  ## iOS Broadcast Screen sharing
281
272
 
282
273
  To enable whole device screen share is required and additional setup.
@@ -324,28 +315,7 @@ You will need to set the **voipHandlingStrategy** and subscribe to **iOSVoipPush
324
315
  > Be aware that notifications VOIP notifications are different compared to push. They must be always handled by ensuring the invocation of the configure and connect methods in index.js or App.js.
325
316
 
326
317
  ## Android Notifications
327
- Supports only **on_call_incoming** and **on_message_sent** notification types.
328
- > Be aware that notifications require **HIGH priority**
329
-
330
- ```javascript
331
- kaleyraVideo.handlePushNotificationPayload(payload);
332
- ```
333
-
334
- Example of acceptable payload
335
- ```json
336
- {
337
- "google.delivered_priority":"high",
338
- "content-available":"1",
339
- "google.sent_time":1663347601917,
340
- "google.ttl":60,
341
- "google.original_priority":"high",
342
- "from":"320",
343
- "title":"",
344
- "google.message_id":"0:1123%ac212d7bf9fd7ecd",
345
- "message":"{\"kaleyra\":{\"payload\":{\"event\":\"on_call_incoming\",\"room_id\":\"room_b36f162\",\"data\":{\"initiator\":\"user1\",\"users\":[{\"user\":{\"userAlias\":\"user2\"},\"status\":\"invited\"},{\"user\":{\"userAlias\":\"user1\"},\"status\":\"invited\"}],\"roomAlias\":\"room_b37a64c6f162\",\"options\":{\"duration\":0,\"record\":true,\"recordingType\":\"manual\",\"recording\":\"manual\",\"creationDate\":\"2022-09-16T17:00:01.457Z\",\"callType\":\"audio_upgradable\",\"live\":true}}},\"user_token\":\"eyJhtokenksadfjoiasdjfoaidjfsoasidjfoi\"}}",
346
- "google.c.sender.id":"320"
347
- }
348
- ```
318
+ Supports automatically **on_call_incoming** and **on_message_sent** notification types.
349
319
 
350
320
  ## Proguard
351
321
  ```groovy
@@ -2,8 +2,10 @@
2
2
  // See LICENSE for licensing information
3
3
 
4
4
  buildscript {
5
- // Buildscript is evaluated before everything else so we can't use getExtOrDefault
6
- def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["ReactNativePlugin_kotlinVersion"]
5
+ ext {
6
+ gradleVersion = "8.1.1"
7
+ kotlinVersion = "1.9.0"
8
+ }
7
9
 
8
10
  repositories {
9
11
  google()
@@ -11,9 +13,8 @@ buildscript {
11
13
  }
12
14
 
13
15
  dependencies {
14
- classpath "com.android.tools.build:gradle:7.2.1"
15
- // noinspection DifferentKotlinGradleVersion
16
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
16
+ classpath "com.android.tools.build:gradle:$gradleVersion"
17
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
17
18
  }
18
19
  }
19
20
 
@@ -21,25 +22,25 @@ def isNewArchitectureEnabled() {
21
22
  return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
22
23
  }
23
24
 
25
+ plugins {
26
+ id 'com.google.devtools.ksp' version "1.9.0-1.0.13"
27
+ }
28
+
24
29
  apply plugin: "com.android.library"
25
30
  apply plugin: "kotlin-android"
26
- apply plugin: 'kotlin-kapt'
27
- apply from: "../native-bridge/android/build.gradle"
31
+ apply from: "../native-bridge/android/bridge.gradle"
28
32
 
29
33
  if (isNewArchitectureEnabled()) {
30
34
  apply plugin: "com.facebook.react"
31
35
  }
32
36
 
33
- def getExtOrDefault(name) {
34
- return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["ReactNativePlugin_" + name]
35
- }
36
-
37
37
  def getExtOrIntegerDefault(name) {
38
38
  return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["ReactNativePlugin_" + name]).toInteger()
39
39
  }
40
40
 
41
41
  android {
42
- compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
42
+ namespace "com.kaleyra.video_react_native_module"
43
+ compileSdk getExtOrIntegerDefault("compileSdkVersion")
43
44
 
44
45
  defaultConfig {
45
46
  minSdkVersion getExtOrIntegerDefault("minSdkVersion")
@@ -52,6 +53,10 @@ android {
52
53
  }
53
54
  }
54
55
 
56
+ buildFeatures {
57
+ buildConfig true
58
+ }
59
+
55
60
  sourceSets {
56
61
  main.java.srcDirs += '../native-bridge/android/src/main/java'
57
62
  test.java.srcDirs += '../native-bridge/android/src/test/java'
@@ -63,33 +68,20 @@ android {
63
68
  }
64
69
 
65
70
  compileOptions {
66
- sourceCompatibility JavaVersion.VERSION_1_8
67
- targetCompatibility JavaVersion.VERSION_1_8
71
+ sourceCompatibility JavaVersion.VERSION_17
72
+ targetCompatibility JavaVersion.VERSION_17
68
73
  }
69
74
 
70
- }
75
+ kotlinOptions {
76
+ jvmTarget = '17'
77
+ }
71
78
 
72
- repositories {
73
- mavenCentral()
74
- google()
75
- maven { url 'https://maven.bandyer.com/releases' }
76
79
  }
77
80
 
78
- def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())
79
-
80
- def kotlin_version = getExtOrDefault("kotlinVersion")
81
+ def REACT_NATIVE_VERSION = new File(['node', '--print', "JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())
81
82
 
82
83
  dependencies {
83
- // For < 0.71, this will be from the local maven repo
84
- // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
85
- // https://github.com/facebook/react-native/blob/d280772ea4b2b945340e88c6b95ffb4c0dd56dac/packages/react-native/android/README.md?plain=1#L13
86
- //noinspection GradleDynamicVersion
87
- implementation "com.facebook.react:react-native:$REACT_NATIVE_VERSION"
88
- implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
89
- }
90
-
91
- subprojects { project ->
92
- apply plugin: 'com.android.library'
84
+ implementation "com.facebook.react:react-android:$REACT_NATIVE_VERSION"
93
85
  }
94
86
 
95
87
  if (isNewArchitectureEnabled()) {
@@ -1,9 +1,9 @@
1
1
  # Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
2
2
  # See LICENSE for licensing information
3
3
 
4
- ReactNativePlugin_kotlinVersion=1.7.0
4
+ ReactNativePlugin_kotlinVersion=1.9.0
5
5
  ReactNativePlugin_minSdkVersion=21
6
- ReactNativePlugin_targetSdkVersion=31
7
- ReactNativePlugin_compileSdkVersion=31
6
+ ReactNativePlugin_targetSdkVersion=34
7
+ ReactNativePlugin_compileSdkVersion=34
8
8
  ReactNativePlugin_ndkversion=21.4.7075529
9
9
  android.useAndroidX=true
@@ -1,6 +1 @@
1
1
  rootProject.name = 'video_react'
2
-
3
- include ':video_hybrid_native_bridge'
4
-
5
- project(':video_hybrid_native_bridge').projectDir = new File('../native-bridge/android')
6
-
@@ -1 +1 @@
1
- <manifest package="com.kaleyra.video_react_native_module"/>
1
+ <manifest/>
@@ -1 +1 @@
1
- React/1.6.0
1
+ React/2.0.0
@@ -79,12 +79,6 @@ class VideoNativeModule(
79
79
  @ReactMethod
80
80
  private fun clearUserCache() = reactNativeVideoHybridBridge.invoke(reactNativeVideoHybridBridge::clearUserCache.name)
81
81
 
82
- @ReactMethod
83
- fun handlePushNotificationPayload(payload: String) = reactNativeVideoHybridBridge.invoke(reactNativeVideoHybridBridge::handlePushNotificationPayload.name, payload)
84
-
85
- @ReactMethod
86
- fun verifyCurrentCall(payload: Boolean) = reactNativeVideoHybridBridge.invoke(reactNativeVideoHybridBridge::verifyCurrentCall.name, payload.toString())
87
-
88
82
  @ReactMethod
89
83
  fun setDisplayModeForCurrentCall(payload: String) = reactNativeVideoHybridBridge.invoke(reactNativeVideoHybridBridge::setDisplayModeForCurrentCall.name, payload)
90
84
 
@@ -94,9 +88,6 @@ class VideoNativeModule(
94
88
  @ReactMethod
95
89
  fun startCallUrl(payload: String) = reactNativeVideoHybridBridge.invoke(reactNativeVideoHybridBridge::startCallUrl.name, payload)
96
90
 
97
- @ReactMethod
98
- fun setUserDetailsFormat(payload: String)= reactNativeVideoHybridBridge.invoke(reactNativeVideoHybridBridge::setUserDetailsFormat.name, payload)
99
-
100
91
  @ReactMethod
101
92
  fun startChat(payload: String) = reactNativeVideoHybridBridge.invoke(reactNativeVideoHybridBridge::startChat.name, payload)
102
93
 
package/index.ts CHANGED
@@ -15,7 +15,6 @@ import {
15
15
  CallType,
16
16
  Regions,
17
17
  UserDetails,
18
- UserDetailsFormat,
19
18
  CallDisplayMode,
20
19
  Session,
21
20
  Environments,
@@ -39,7 +38,6 @@ export {
39
38
  CallType,
40
39
  Regions,
41
40
  UserDetails,
42
- UserDetailsFormat,
43
41
  CallDisplayMode,
44
42
  Session,
45
43
  Environments,
@@ -7,7 +7,7 @@ import Foundation
7
7
  class _KaleyraVideoHybridVersionInfo: NSObject {
8
8
 
9
9
  @objc
10
- static let krvVersion: String = "1.6.0"
10
+ static let krvVersion: String = "2.0.0"
11
11
 
12
12
  @objc
13
13
  static let krvPlatform: String = "react"
@@ -7,8 +7,6 @@
7
7
 
8
8
  RCT_EXTERN_METHOD(configure:(NSString *)json)
9
9
 
10
- RCT_EXTERN_METHOD(setUserDetailsFormat:(NSString *)json)
11
-
12
10
  RCT_EXTERN_METHOD(setAccessTokenResponse:(NSString *)json)
13
11
 
14
12
  RCT_EXTERN_METHOD(connect:(NSString *)userID)
@@ -19,8 +17,6 @@ RCT_EXTERN_METHOD(reset)
19
17
 
20
18
  RCT_EXTERN_METHOD(startCall:(NSString *)json)
21
19
 
22
- RCT_EXTERN_METHOD(verifyCurrentCall:(BOOL *)verify)
23
-
24
20
  RCT_EXTERN_METHOD(setDisplayModeForCurrentCall:(NSString *)mode)
25
21
 
26
22
  RCT_EXTERN_METHOD(startCallUrl:(NSString *)url)
@@ -29,8 +25,6 @@ RCT_EXTERN_METHOD(addUsersDetails:(NSString *)json)
29
25
 
30
26
  RCT_EXTERN_METHOD(removeUsersDetails)
31
27
 
32
- RCT_EXTERN_METHOD(handlePushNotificationPayload:(NSString *)json)
33
-
34
28
  RCT_EXTERN_METHOD(startChat:(NSString *)userID)
35
29
 
36
30
  RCT_EXTERN_METHOD(clearUserCache)
@@ -2,7 +2,7 @@
2
2
  // See LICENSE for licensing information
3
3
 
4
4
  import Foundation
5
- import Bandyer
5
+ import KaleyraVideoSDK
6
6
  import React
7
7
 
8
8
  @available(iOS 12.0, *)
@@ -38,13 +38,6 @@ class VideoNativeModule: NSObject {
38
38
  }
39
39
  }
40
40
 
41
- @objc(setUserDetailsFormat:)
42
- func setUserDetailsFormat(json: String) {
43
- perform {
44
- bridge.setUserDetailsFormat(try UserDetailsFormat.decodeJSON(json))
45
- }
46
- }
47
-
48
41
  @objc(setAccessTokenResponse:)
49
42
  func setAccessTokenResponse(json: String) {
50
43
  perform {
@@ -95,13 +88,6 @@ class VideoNativeModule: NSObject {
95
88
  }
96
89
  }
97
90
 
98
- @objc(verifyCurrentCall:)
99
- func verifyCurrentCall(verify: Bool) {
100
- perform {
101
- try bridge.verifyCurrentCall(verify)
102
- }
103
- }
104
-
105
91
  @objc(setDisplayModeForCurrentCall:)
106
92
  func setDisplayModeForCurrentCall(mode: String) {
107
93
  bridge.setDisplayModeForCurrentCall(mode)
@@ -119,11 +105,6 @@ class VideoNativeModule: NSObject {
119
105
  bridge.removeUsersDetails()
120
106
  }
121
107
 
122
- @objc(handlePushNotificationPayload:)
123
- func handlePushNotificationPayload(json: String) {
124
- bridge.handlePushNotificationPayload(json)
125
- }
126
-
127
108
  @objc(startChat:)
128
109
  func startChat(userID: String) {
129
110
  perform {
@@ -4,7 +4,6 @@
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.Environments = exports.CallDisplayMode = exports.Regions = exports.CallType = exports.VoipHandlingStrategy = exports.RecordingType = exports.AudioCallType = exports.KaleyraVideo = void 0;
6
6
  const react_native_1 = require("react-native");
7
- const UserDetailsFormatValidator_1 = require("../native-bridge/TypeScript/UserDetailsFormatValidator");
8
7
  const CallType_1 = require("../native-bridge/TypeScript/types/CallType");
9
8
  Object.defineProperty(exports, "CallType", { enumerable: true, get: function () { return CallType_1.CallType; } });
10
9
  const IllegalArgumentError_1 = require("../native-bridge/TypeScript/errors/IllegalArgumentError");
@@ -148,19 +147,6 @@ class KaleyraVideo {
148
147
  }
149
148
  VideoNativeModuleBridge.startCall(JSON.stringify(callOptions));
150
149
  }
151
- /**
152
- * Verify the user for the current call
153
- * @param verify true if the user is verified, false otherwise
154
- * @throws IllegalArgumentError
155
- */
156
- verifyCurrentCall(verify) {
157
- if (KaleyraVideo._isAndroid()) {
158
- VideoNativeModuleBridge.verifyCurrentCall(verify);
159
- }
160
- else {
161
- console.warn('Not yet supported on ', react_native_1.Platform.OS, ' platform.');
162
- }
163
- }
164
150
  /**
165
151
  * Set the UI display mode for the current call
166
152
  * @param mode FOREGROUND, FOREGROUND_PICTURE_IN_PICTURE, BACKGROUND
@@ -197,32 +183,12 @@ class KaleyraVideo {
197
183
  }
198
184
  VideoNativeModuleBridge.addUsersDetails(JSON.stringify(userDetails));
199
185
  }
200
- setUserDetailsFormat(format) {
201
- const validator = new UserDetailsFormatValidator_1.UserDetailsFormatValidator();
202
- validator.validate(format.default);
203
- if (format.androidNotification !== undefined) {
204
- validator.validate(format.androidNotification);
205
- }
206
- VideoNativeModuleBridge.setUserDetailsFormat(JSON.stringify(format));
207
- }
208
186
  /**
209
187
  * Call this method to remove all the user details previously provided.
210
188
  */
211
189
  removeUsersDetails() {
212
190
  VideoNativeModuleBridge.removeUsersDetails();
213
191
  }
214
- /**
215
- * Call this method to handle a notification!
216
- *
217
- * @param payload notification data payload as String
218
- * @throws IllegalArgumentError
219
- */
220
- handlePushNotificationPayload(payload) {
221
- if (payload === '' || payload === 'undefined') {
222
- throw new IllegalArgumentError_1.IllegalArgumentError('Expected a not empty payload!');
223
- }
224
- VideoNativeModuleBridge.handlePushNotificationPayload(JSON.stringify(payload));
225
- }
226
192
  /**
227
193
  * Open chat
228
194
  * @param userID user you want to chat with
@@ -1,7 +1,6 @@
1
1
  // Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
2
2
  // See LICENSE for licensing information
3
3
  import { NativeModules, Platform } from 'react-native';
4
- import { UserDetailsFormatValidator } from '../native-bridge/TypeScript/UserDetailsFormatValidator';
5
4
  import { CallType } from '../native-bridge/TypeScript/types/CallType';
6
5
  import { IllegalArgumentError } from '../native-bridge/TypeScript/errors/IllegalArgumentError';
7
6
  import { Environments } from '../native-bridge/TypeScript/Environments';
@@ -138,19 +137,6 @@ class KaleyraVideo {
138
137
  }
139
138
  VideoNativeModuleBridge.startCall(JSON.stringify(callOptions));
140
139
  }
141
- /**
142
- * Verify the user for the current call
143
- * @param verify true if the user is verified, false otherwise
144
- * @throws IllegalArgumentError
145
- */
146
- verifyCurrentCall(verify) {
147
- if (KaleyraVideo._isAndroid()) {
148
- VideoNativeModuleBridge.verifyCurrentCall(verify);
149
- }
150
- else {
151
- console.warn('Not yet supported on ', Platform.OS, ' platform.');
152
- }
153
- }
154
140
  /**
155
141
  * Set the UI display mode for the current call
156
142
  * @param mode FOREGROUND, FOREGROUND_PICTURE_IN_PICTURE, BACKGROUND
@@ -187,32 +173,12 @@ class KaleyraVideo {
187
173
  }
188
174
  VideoNativeModuleBridge.addUsersDetails(JSON.stringify(userDetails));
189
175
  }
190
- setUserDetailsFormat(format) {
191
- const validator = new UserDetailsFormatValidator();
192
- validator.validate(format.default);
193
- if (format.androidNotification !== undefined) {
194
- validator.validate(format.androidNotification);
195
- }
196
- VideoNativeModuleBridge.setUserDetailsFormat(JSON.stringify(format));
197
- }
198
176
  /**
199
177
  * Call this method to remove all the user details previously provided.
200
178
  */
201
179
  removeUsersDetails() {
202
180
  VideoNativeModuleBridge.removeUsersDetails();
203
181
  }
204
- /**
205
- * Call this method to handle a notification!
206
- *
207
- * @param payload notification data payload as String
208
- * @throws IllegalArgumentError
209
- */
210
- handlePushNotificationPayload(payload) {
211
- if (payload === '' || payload === 'undefined') {
212
- throw new IllegalArgumentError('Expected a not empty payload!');
213
- }
214
- VideoNativeModuleBridge.handlePushNotificationPayload(JSON.stringify(payload));
215
- }
216
182
  /**
217
183
  * Open chat
218
184
  * @param userID user you want to chat with
@@ -1,2 +1,2 @@
1
- import { KaleyraVideo, KaleyraVideoConfiguration, CreateCallOptions, Tools, ScreenShareToolConfiguration, ChatToolConfiguration, AudioCallOptions, AudioCallType, CallOptions, RecordingType, IosConfiguration, CallKitConfiguration, VoipHandlingStrategy, CallType, Regions, UserDetails, UserDetailsFormat, CallDisplayMode, Session, Environments, Events } from './src/KaleyraVideo';
2
- export { KaleyraVideo, KaleyraVideoConfiguration, CreateCallOptions, Tools, ScreenShareToolConfiguration, ChatToolConfiguration, AudioCallOptions, AudioCallType, CallOptions, RecordingType, IosConfiguration, CallKitConfiguration, VoipHandlingStrategy, CallType, Regions, UserDetails, UserDetailsFormat, CallDisplayMode, Session, Environments, Events, };
1
+ import { KaleyraVideo, KaleyraVideoConfiguration, CreateCallOptions, Tools, ScreenShareToolConfiguration, ChatToolConfiguration, AudioCallOptions, AudioCallType, CallOptions, RecordingType, IosConfiguration, CallKitConfiguration, VoipHandlingStrategy, CallType, Regions, UserDetails, CallDisplayMode, Session, Environments, Events } from './src/KaleyraVideo';
2
+ export { KaleyraVideo, KaleyraVideoConfiguration, CreateCallOptions, Tools, ScreenShareToolConfiguration, ChatToolConfiguration, AudioCallOptions, AudioCallType, CallOptions, RecordingType, IosConfiguration, CallKitConfiguration, VoipHandlingStrategy, CallType, Regions, UserDetails, CallDisplayMode, Session, Environments, Events, };
@@ -7,23 +7,11 @@ export interface UserDetails {
7
7
  */
8
8
  userID: string;
9
9
  /**
10
- * Nickname for the user
10
+ * The user's display name.
11
11
  */
12
- nickName?: string;
13
- /**
14
- * First name of the user
15
- */
16
- firstName?: string;
17
- /**
18
- * Last name of the user
19
- */
20
- lastName?: string;
21
- /**
22
- * Email of the user
23
- */
24
- email?: string;
12
+ name?: string;
25
13
  /**
26
14
  * Image url to use as placeholder for the user.
27
15
  */
28
- profileImageUrl?: string;
16
+ imageUrl?: string;
29
17
  }
@@ -1,7 +1,6 @@
1
1
  import type { KaleyraVideoConfiguration } from '../native-bridge/TypeScript/types/KaleyraVideoConfiguration';
2
2
  import type { CreateCallOptions } from '../native-bridge/TypeScript/types/CreateCallOptions';
3
3
  import type { UserDetails } from '../native-bridge/TypeScript/types/UserDetails';
4
- import type { UserDetailsFormat } from '../native-bridge/TypeScript/types/UserDetailsFormat';
5
4
  import { CallType } from '../native-bridge/TypeScript/types/CallType';
6
5
  import { Environments } from '../native-bridge/TypeScript/Environments';
7
6
  import { CallDisplayMode } from '../native-bridge/TypeScript/types/CallDisplayMode';
@@ -70,12 +69,6 @@ declare class KaleyraVideo {
70
69
  * @throws IllegalArgumentError
71
70
  */
72
71
  startCall(callOptions: CreateCallOptions): void;
73
- /**
74
- * Verify the user for the current call
75
- * @param verify true if the user is verified, false otherwise
76
- * @throws IllegalArgumentError
77
- */
78
- verifyCurrentCall(verify: boolean): void;
79
72
  /**
80
73
  * Set the UI display mode for the current call
81
74
  * @param mode FOREGROUND, FOREGROUND_PICTURE_IN_PICTURE, BACKGROUND
@@ -94,18 +87,10 @@ declare class KaleyraVideo {
94
87
  * @throws IllegalArgumentError
95
88
  */
96
89
  addUsersDetails(userDetails: UserDetails[]): void;
97
- setUserDetailsFormat(format: UserDetailsFormat): void;
98
90
  /**
99
91
  * Call this method to remove all the user details previously provided.
100
92
  */
101
93
  removeUsersDetails(): void;
102
- /**
103
- * Call this method to handle a notification!
104
- *
105
- * @param payload notification data payload as String
106
- * @throws IllegalArgumentError
107
- */
108
- handlePushNotificationPayload(payload: string): void;
109
94
  /**
110
95
  * Open chat
111
96
  * @param userID user you want to chat with
@@ -122,4 +107,4 @@ declare class KaleyraVideo {
122
107
  */
123
108
  getCurrentVoIPPushToken(): Promise<string>;
124
109
  }
125
- export { KaleyraVideo, KaleyraVideoConfiguration, CreateCallOptions, Tools, ScreenShareToolConfiguration, ChatToolConfiguration, AudioCallOptions, AudioCallType, CallOptions, RecordingType, IosConfiguration, CallKitConfiguration, VoipHandlingStrategy, CallType, Regions, UserDetails, UserDetailsFormat, CallDisplayMode, Session, Environments, Events, };
110
+ export { KaleyraVideo, KaleyraVideoConfiguration, CreateCallOptions, Tools, ScreenShareToolConfiguration, ChatToolConfiguration, AudioCallOptions, AudioCallType, CallOptions, RecordingType, IosConfiguration, CallKitConfiguration, VoipHandlingStrategy, CallType, Regions, UserDetails, CallDisplayMode, Session, Environments, Events, };
@@ -11,27 +11,12 @@ export interface UserDetails {
11
11
  userID: string;
12
12
 
13
13
  /**
14
- * Nickname for the user
14
+ * The user's display name.
15
15
  */
16
- nickName?: string;
17
-
18
- /**
19
- * First name of the user
20
- */
21
- firstName?: string;
22
-
23
- /**
24
- * Last name of the user
25
- */
26
- lastName?: string;
27
-
28
- /**
29
- * Email of the user
30
- */
31
- email?: string;
16
+ name?: string;
32
17
 
33
18
  /**
34
19
  * Image url to use as placeholder for the user.
35
20
  */
36
- profileImageUrl?: string;
21
+ imageUrl?: string;
37
22
  }