@kaleyra/video-react-native-module 1.1.2 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -24,7 +24,14 @@ yarn link
|
|
|
24
24
|
cd example
|
|
25
25
|
# nano .env use your own keys
|
|
26
26
|
yarn link @kaleyra/video-react-native-module
|
|
27
|
-
yarn
|
|
27
|
+
yarn pods
|
|
28
|
+
yarn ios
|
|
29
|
+
yarn android
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Reset react native build cache
|
|
33
|
+
```shell
|
|
34
|
+
react-native start --reset-cache
|
|
28
35
|
```
|
|
29
36
|
|
|
30
37
|
## How to install the module:
|
|
@@ -35,6 +42,37 @@ Open the **terminal** in your React-Native-App folder and run the following comm
|
|
|
35
42
|
npm install @kaleyra/video-react-native-module
|
|
36
43
|
```
|
|
37
44
|
|
|
45
|
+
# Android additional configuration may be required (depends on your integration)
|
|
46
|
+
- add tools:replace="android:allowBackup" to AndroidManifest.xml. See here for an [example](https://github.com/KaleyraVideo/VideoReactNativeModule/blob/main/example/android/app/src/main/AndroidManifest.xml#L8)
|
|
47
|
+
- add maven { url 'https://maven.bandyer.com/releases' } in build.gradle. See here for an [example](https://github.com/KaleyraVideo/VideoReactNativeModule/blob/1599d0f355e4a699a92404c450102e519cfe2866/example/android/build.gradle#L32)
|
|
48
|
+
|
|
49
|
+
### Standalone iOS framework
|
|
50
|
+
|
|
51
|
+
In case your application already provides the WebRTC framework in a third party module, a conflict may arise when trying to install the depedencies through Cocoapods.
|
|
52
|
+
In order to resolve the conflict you can download and install the Kaleyra Video iOS framework as a standalone package.
|
|
53
|
+
To enable the standalone framework you must change your application's Podfile declaring the `$KaleyraNoWebRTC` variable before the first target definition. You can give whatever value you want to the variable as long as it is defined before the target definitions.
|
|
54
|
+
|
|
55
|
+
```ruby
|
|
56
|
+
platform :ios, min_ios_version_supported
|
|
57
|
+
prepare_react_native_project!
|
|
58
|
+
|
|
59
|
+
# use_frameworks! is required for using Bandyer framework, linkage static is required by React Native instead.
|
|
60
|
+
use_frameworks! :linkage => :static
|
|
61
|
+
|
|
62
|
+
$KaleyraNoWebRTC = ''
|
|
63
|
+
|
|
64
|
+
target 'KaleyraVideoReact' do
|
|
65
|
+
config = use_native_modules!
|
|
66
|
+
|
|
67
|
+
# Flags change depending on the env values.
|
|
68
|
+
flags = get_default_flags()
|
|
69
|
+
[...]
|
|
70
|
+
end
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
> [!CAUTION]
|
|
74
|
+
> Use the standalone framework only as a last resort in case you have a WebRTC framework conflict. Because we cannot guarantee that the WebRTC framework you are using is compatible with our SDK, you are responsible for assess the compatibility with our module. However, WebRTC versions greater than or equal to M100 should work fine.
|
|
75
|
+
|
|
38
76
|
## How to remove the module:
|
|
39
77
|
|
|
40
78
|
```shell
|
|
@@ -134,7 +172,7 @@ kaleyraVideo.events.oniOSVoipPushTokenUpdated = (token: string) => {
|
|
|
134
172
|
```
|
|
135
173
|
**Warning:** Make sure this listener is attached before calling kaleyraVideo.connect(_), otherwise the event reporting the device token could be missed.
|
|
136
174
|
|
|
137
|
-
The token provided in the callback is the **string** representation of your device token.
|
|
175
|
+
The token provided in the callback is the **string** representation of your device token.
|
|
138
176
|
Here's an example of a device token: **dec105f879924349fd2fa9aa8bb8b70431d5f41d57bfa8e31a5d80a629774fd9**
|
|
139
177
|
|
|
140
178
|
### VoIP notification payload
|
|
@@ -145,7 +183,11 @@ Here's an example of a device token: **dec105f879924349fd2fa9aa8bb8b70431d5f41d5
|
|
|
145
183
|
## Module connect
|
|
146
184
|
|
|
147
185
|
To connect the plugin to the Kaleyra Video system you will need to provide a Session object.
|
|
148
|
-
The session needs a userID and a function returning a promise with the access token for that user
|
|
186
|
+
The session needs a userID and a function returning a promise with the access token for that user.
|
|
187
|
+
|
|
188
|
+
> [!IMPORTANT]
|
|
189
|
+
> - The *userID* should aready exists in our service. Your backend needs to create it by invoking this api [create_user](https://developers.kaleyra.io/reference/video-v2-user-post)
|
|
190
|
+
> - The *accessToken* should be generated from your backend by invoking this api [get_credentials](https://developers.kaleyra.io/reference/video-v2-sdk-post). Be aware that it expires. The callback will be called multiple times every time a new token is needed to refresh the user session.
|
|
149
191
|
|
|
150
192
|
```javascript
|
|
151
193
|
kaleyraVideo.connect({
|
|
@@ -305,7 +347,7 @@ Example of acceptable payload
|
|
|
305
347
|
}
|
|
306
348
|
```
|
|
307
349
|
|
|
308
|
-
## Proguard
|
|
350
|
+
## Proguard
|
|
309
351
|
```groovy
|
|
310
352
|
# Bandyer now Kaleyra proprietary SDK
|
|
311
353
|
-keep class com.bandyer.** { *; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
React/1.1
|
|
1
|
+
React/1.2.1
|
|
@@ -48,7 +48,7 @@ android {
|
|
|
48
48
|
dependencies {
|
|
49
49
|
implementation 'com.google.code.gson:gson:2.9.1'
|
|
50
50
|
implementation "com.kaleyra:collaboration-suite-utils:3.0.6"
|
|
51
|
-
implementation "com.bandyer:bandyer-android-sdk:3.
|
|
51
|
+
implementation "com.bandyer:bandyer-android-sdk:3.8.2"
|
|
52
52
|
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
|
|
53
53
|
compileOnly "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.1"
|
|
54
54
|
implementation "androidx.room:room-runtime:2.4.0-beta02"
|
package/package.json
CHANGED
|
@@ -19,9 +19,9 @@ Pod::Spec.new do |s|
|
|
|
19
19
|
s.dependency "React-Core"
|
|
20
20
|
|
|
21
21
|
if defined?($KaleyraNoWebRTC)
|
|
22
|
-
s.dependency "Bandyer/Core", "~> 3.
|
|
22
|
+
s.dependency "Bandyer/Core", "~> 3.11.0"
|
|
23
23
|
else
|
|
24
|
-
s.dependency "Bandyer", "~> 3.
|
|
24
|
+
s.dependency "Bandyer", "~> 3.11.0"
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
# Don't install the dependencies when we run `pod install` in the old architecture.
|