omikit-plugin 2.2.0 → 2.2.2

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
@@ -141,7 +141,7 @@ You can refer <a href="https://github.com/VIHATTeam/OMICALL-React-Native-SDK/blo
141
141
  - Add `google-service.json` in `android/app` (For more information, you can refer <a href="https://rnfirebase.io/app/usage">Core/App</a>)
142
142
  - Add Fire Messaging to receive `fcm_token` (You can refer <a href="https://rnfirebase.io/messaging/usage">Cloud Messaging</a> to setup notification for React native)
143
143
 
144
- - For more setting information, please refer <a href="https://rnfirebase.io/messaging/usage">Config Push for Android</a>
144
+ - For more setting information, please refer <a href="https://api.omicall.com/web-sdk/mobile-sdk/android-sdk/cau-hinh-push-notification">Config Push for Android</a>
145
145
 
146
146
  #### iOS:
147
147
 
@@ -230,7 +230,7 @@ if (@available(iOS 10.0, *)) {
230
230
 
231
231
  ```
232
232
 
233
- *** Only use under lines when added `Cloud Messaging` plugin in your project ***
233
+ **_ Only use under lines when added `Cloud Messaging` plugin in your project _**
234
234
 
235
235
  - Setup push notification: We only support Firebase for push notification.
236
236
 
@@ -250,6 +250,7 @@ if (@available(iOS 10.0, *)) {
250
250
  ```
251
251
 
252
252
  - Important function.
253
+
253
254
  - Start Serivce: OmiKit need start services and register some events.
254
255
 
255
256
  ```
@@ -297,6 +298,7 @@ if (@available(iOS 10.0, *)) {
297
298
  import { configPushNotification } from 'omikit-plugin';
298
299
 
299
300
  configPushNotification({
301
+ notificationIcon : "calling_face", //notification icon on Android
300
302
  prefix : "Cuộc gọi tới từ: ",
301
303
  declineTitle : "Từ chối",
302
304
  acceptTitle : "Chấp nhận",
@@ -326,6 +328,7 @@ if (@available(iOS 10.0, *)) {
326
328
  ```
327
329
 
328
330
  - Upload token: OmiKit need FCM for Android and APNS to push notification on user devices. We use more packages: <a href="https://rnfirebase.io/messaging/usage">Cloud Messaging</a> and <a href="https://www.npmjs.com/package/react-native-device-info?activeTab=readme">react-native-device-info</a>
331
+
329
332
  ```
330
333
  import { updateToken } from 'omikit-plugin';
331
334
  const fcmToken = await fcm;
@@ -341,7 +344,9 @@ if (@available(iOS 10.0, *)) {
341
344
  ```
342
345
 
343
346
  - Other functions:
347
+
344
348
  - Call with phone number (mobile phone or internal number):
349
+
345
350
  ```
346
351
  import {startCall} from 'omikit-plugin';
347
352
  const result = await startCall({
@@ -349,7 +354,9 @@ if (@available(iOS 10.0, *)) {
349
354
  isVideo: false //allow video call: true/false
350
355
  });
351
356
  ```
357
+
352
358
  - Call with UUID (only support with Api key):
359
+
353
360
  ```
354
361
  import {startCallWithUuid} from 'omikit-plugin';
355
362
  const result = await startCallWithUuid({
@@ -357,6 +364,7 @@ if (@available(iOS 10.0, *)) {
357
364
  isVideo: false //allow video call: true/false
358
365
  });
359
366
  ```
367
+
360
368
  - Accept a call:
361
369
 
362
370
  ```
@@ -410,10 +418,11 @@ if (@available(iOS 10.0, *)) {
410
418
  character: text,
411
419
  });
412
420
  ```
421
+
413
422
  - Get current user information:
414
423
  ```
415
424
  final user = await getCurrentUser();
416
- Output Sample:
425
+ Output Sample:
417
426
  {
418
427
  "extension": "111",
419
428
  "full_name": "chau1",
@@ -424,7 +433,7 @@ if (@available(iOS 10.0, *)) {
424
433
  - Get guest user information:
425
434
  ```
426
435
  final user = await getGuestUser();
427
- Output Sample:
436
+ Output Sample:
428
437
  {
429
438
  "extension": "111",
430
439
  "full_name": "chau1",
@@ -433,9 +442,10 @@ if (@available(iOS 10.0, *)) {
433
442
  }
434
443
  ```
435
444
  - Get user information from sip:
445
+
436
446
  ```
437
447
  final user = await getUserInfo("111");
438
- Output Sample:
448
+ Output Sample:
439
449
  {
440
450
  "extension": "111",
441
451
  "full_name": "chau1",
@@ -451,6 +461,7 @@ if (@available(iOS 10.0, *)) {
451
461
 
452
462
  logout();
453
463
  ```
464
+
454
465
  - Video Call functions: Support only video call, You need enable video in `init functions` and `start call` to implements under functions.
455
466
 
456
467
  - Switch front/back camera: We use the front camera for first time.
@@ -96,7 +96,7 @@ dependencies {
96
96
  implementation "com.facebook.react:react-native:+" // From node_modules
97
97
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
98
98
 
99
- api 'vn.vihat.omicall:omi-sdk:1.1.24'
99
+ api 'vn.vihat.omicall:omi-sdk:1.2.1'
100
100
 
101
101
  implementation 'androidx.core:core-ktx:1.7.0'
102
102
  implementation 'androidx.fragment:fragment-ktx:1.4.0'
@@ -51,7 +51,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
51
51
  val map: WritableMap = WritableNativeMap()
52
52
  val timeStartToAnswer = call["time_start_to_answer"] as Long?
53
53
  val timeEnd = call["time_end"] as Long
54
- map.putString("transaction_id", call["transaction_id"] as String)
54
+ map.putString("transaction_id", call["transaction_id"] as String?)
55
55
  map.putString("direction", call["direction"] as String)
56
56
  map.putString("source_number", call["source_number"] as String)
57
57
  map.putString("destination_number", call["destination_number"] as String)
@@ -139,6 +139,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
139
139
  @ReactMethod
140
140
  fun configPushNotification(data: ReadableMap, promise: Promise) {
141
141
  currentActivity?.runOnUiThread {
142
+ val notificationIcon = data.getString("notificationIcon")
142
143
  val prefix = data.getString("prefix")
143
144
  val declineTitle = data.getString("declineTitle")
144
145
  val acceptTitle = data.getString("acceptTitle")
@@ -152,6 +153,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
152
153
  val backImage = data.getString("backImage")
153
154
  val userImage = data.getString("userImage")
154
155
  OmiClient.instance.configPushNotification(
156
+ notificationIcon = notificationIcon ?: "",
155
157
  prefix = prefix ?: "Cuộc gọi tới từ: ",
156
158
  declineTitle = declineTitle ?: "Từ chối",
157
159
  acceptTitle = acceptTitle ?: "Chấp nhận",
@@ -312,7 +314,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
312
314
  val map: WritableMap = WritableNativeMap()
313
315
  val timeStartToAnswer = call["time_start_to_answer"] as Long?
314
316
  val timeEnd = call["time_end"] as Long
315
- map.putString("transaction_id", call["transaction_id"] as String)
317
+ map.putString("transaction_id", call["transaction_id"] as String?)
316
318
  map.putString("direction", call["direction"] as String)
317
319
  map.putString("source_number", call["source_number"] as String)
318
320
  map.putString("destination_number", call["destination_number"] as String)
@@ -32,5 +32,5 @@ Pod::Spec.new do |s|
32
32
  s.dependency "RCTTypeSafety"
33
33
  s.dependency "ReactCommon/turbomodule/core"
34
34
  end
35
- s.dependency "OmiKit", '1.5.29'
35
+ s.dependency "OmiKit", '1.5.30'
36
36
  end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omikit-plugin",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "Omikit Plugin by ViHAT",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",