omikit-plugin 2.3.1 → 2.3.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
|
@@ -305,8 +305,9 @@ if (@available(iOS 10.0, *)) {
|
|
|
305
305
|
incomingDeclineButtonImage : "hangup", //image name
|
|
306
306
|
backImage : "ic_back", //image name: icon of back button
|
|
307
307
|
userImage : "calling_face", //image name: icon of user default
|
|
308
|
-
prefixMissedCallMessage: 'Cuộc gọi nhỡ từ' //config prefix message for the missed call
|
|
309
|
-
missedCallTitle: 'Cuộc gọi nhỡ' //config title for the missed call
|
|
308
|
+
prefixMissedCallMessage: 'Cuộc gọi nhỡ từ', //config prefix message for the missed call
|
|
309
|
+
missedCallTitle: 'Cuộc gọi nhỡ', //config title for the missed call
|
|
310
|
+
userNameKey: 'uuid', //we have 3 values: uuid, full_name, extension.
|
|
310
311
|
});
|
|
311
312
|
//incomingAcceptButtonImage, incomingDeclineButtonImage, backImage, userImage: Add these into `android/app/src/main/res/drawble`
|
|
312
313
|
```
|
package/android/build.gradle
CHANGED
|
@@ -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.2.
|
|
99
|
+
api 'vn.vihat.omicall:omi-sdk:1.2.27'
|
|
100
100
|
|
|
101
101
|
implementation 'androidx.core:core-ktx:1.7.0'
|
|
102
102
|
implementation 'androidx.fragment:fragment-ktx:1.4.0'
|
|
@@ -125,12 +125,12 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
125
125
|
override fun initialize() {
|
|
126
126
|
super.initialize()
|
|
127
127
|
reactApplicationContext!!.addActivityEventListener(this)
|
|
128
|
+
OmiClient(context = reactApplicationContext!!)
|
|
129
|
+
OmiClient.instance.setListener(callListener)
|
|
128
130
|
}
|
|
129
131
|
|
|
130
132
|
@ReactMethod
|
|
131
133
|
fun startServices(promise: Promise) {
|
|
132
|
-
OmiClient(context = reactApplicationContext!!)
|
|
133
|
-
OmiClient.instance.setListener(callListener)
|
|
134
134
|
OmiClient.instance.addAccountListener(accountListener)
|
|
135
135
|
promise.resolve(true)
|
|
136
136
|
}
|
|
@@ -146,6 +146,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
146
146
|
val prefixMissedCallMessage = data.getString("prefixMissedCallMessage")
|
|
147
147
|
val backImage = data.getString("backImage")
|
|
148
148
|
val userImage = data.getString("userImage")
|
|
149
|
+
val userNameKey = data.getString("userNameKey")
|
|
149
150
|
OmiClient.instance.configPushNotification(
|
|
150
151
|
notificationIcon = notificationIcon ?: "",
|
|
151
152
|
prefix = prefix ?: "Cuộc gọi tới từ: ",
|
|
@@ -155,7 +156,8 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
155
156
|
backImage = backImage ?: "ic_back",
|
|
156
157
|
userImage = userImage ?: "calling_face",
|
|
157
158
|
prefixMissedCallMessage = prefixMissedCallMessage ?: "Cuộc gọi nhỡ từ",
|
|
158
|
-
missedCallTitle = prefixMissedCallMessage ?: "Cuộc gọi nhỡ"
|
|
159
|
+
missedCallTitle = prefixMissedCallMessage ?: "Cuộc gọi nhỡ",
|
|
160
|
+
userNameKey = userNameKey ?: "extension",
|
|
159
161
|
)
|
|
160
162
|
promise.resolve(true)
|
|
161
163
|
}
|
|
@@ -99,10 +99,15 @@ class CallManager {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
func configNotification(data: [String: Any]) {
|
|
102
|
+
let user = UserDefaults.standard
|
|
103
|
+
if let prefix = data["prefix"] as? String, let userNameKey = data["userNameKey"] as? String {
|
|
104
|
+
user.set(prefix, forKey: KEY_OMI_PREFIX)
|
|
105
|
+
user.set(userNameKey, forKey: KEY_OMI_USER_NAME_KEY)
|
|
106
|
+
}
|
|
102
107
|
if let title = data["missedCallTitle"] as? String, let message = data["prefixMissedCallMessage"] as? String {
|
|
103
108
|
let user = UserDefaults.standard
|
|
104
|
-
user.set(title, forKey: "missedCallTitle")
|
|
105
|
-
user.set(message, forKey: "prefixMissedCallMessage")
|
|
109
|
+
user.set(title, forKey: "omicall/missedCallTitle")
|
|
110
|
+
user.set(message, forKey: "omicall/prefixMissedCallMessage")
|
|
106
111
|
}
|
|
107
112
|
}
|
|
108
113
|
|
|
@@ -114,8 +119,8 @@ class CallManager {
|
|
|
114
119
|
break
|
|
115
120
|
case .authorized, .provisional:
|
|
116
121
|
let user = UserDefaults.standard
|
|
117
|
-
let title = user.string(forKey: "missedCallTitle") ?? ""
|
|
118
|
-
let message = user.string(forKey: "prefixMissedCallMessage") ?? ""
|
|
122
|
+
let title = user.string(forKey: "omicall/missedCallTitle") ?? ""
|
|
123
|
+
let message = user.string(forKey: "omicall/prefixMissedCallMessage") ?? ""
|
|
119
124
|
let content = UNMutableNotificationContent()
|
|
120
125
|
content.title = title
|
|
121
126
|
content.body = "\(message) \(call.callerNumber!)"
|
package/omikit-plugin.podspec
CHANGED