@zelloptt/react-native-zello-sdk 0.3.2 → 0.4.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.
- package/README.md +14 -1
- package/android/build.gradle +5 -3
- package/android/src/main/java/com/zellosdk/ZelloAndroidSdkModule.kt +45 -0
- package/android/src/main/java/com/zellosdk/ZelloAndroidSdkModuleHelper.kt +23 -0
- package/ios/Extensions/ZelloConsoleSettings+Extension.swift +9 -0
- package/ios/Extensions/ZelloContact+Extension.swift +7 -2
- package/ios/Extensions/ZelloDispatchCall+Extension.swift +13 -0
- package/ios/Extensions/ZelloIOSSdkModule+Extension.swift +37 -1
- package/ios/ZelloIOSSdkModule.swift +17 -2
- package/ios/ZelloIOSSdkModuleBridge.m +3 -1
- package/lib/commonjs/docs/assets/highlight.css +13 -6
- package/lib/commonjs/docs/assets/main.js +1 -1
- package/lib/commonjs/docs/assets/main.js.map +1 -1
- package/lib/commonjs/docs/assets/navigation.js +1 -1
- package/lib/commonjs/docs/assets/navigation.js.map +1 -1
- package/lib/commonjs/docs/assets/search.js +1 -1
- package/lib/commonjs/docs/assets/search.js.map +1 -1
- package/lib/commonjs/docs/classes/sdk.Zello.html +48 -40
- package/lib/commonjs/docs/classes/types.ZelloAlertMessage.html +7 -7
- package/lib/commonjs/docs/classes/types.ZelloChannel.html +8 -8
- package/lib/commonjs/docs/classes/types.ZelloChannelUser.html +2 -2
- package/lib/commonjs/docs/classes/types.ZelloConsoleSettings.html +5 -0
- package/lib/commonjs/docs/classes/types.ZelloDispatchCall.html +7 -0
- package/lib/commonjs/docs/classes/types.ZelloDispatchChannel.html +19 -0
- package/lib/commonjs/docs/classes/types.ZelloHistoryAlertMessage.html +8 -8
- package/lib/commonjs/docs/classes/types.ZelloHistoryImageMessage.html +7 -7
- package/lib/commonjs/docs/classes/types.ZelloHistoryLocationMessage.html +11 -11
- package/lib/commonjs/docs/classes/types.ZelloHistoryTextMessage.html +8 -8
- package/lib/commonjs/docs/classes/types.ZelloHistoryVoiceMessage.html +8 -8
- package/lib/commonjs/docs/classes/types.ZelloImageMessage.html +8 -8
- package/lib/commonjs/docs/classes/types.ZelloIncomingEmergency.html +7 -7
- package/lib/commonjs/docs/classes/types.ZelloIncomingVoiceMessage.html +6 -6
- package/lib/commonjs/docs/classes/types.ZelloLocationMessage.html +10 -10
- package/lib/commonjs/docs/classes/types.ZelloOutgoingEmergency.html +5 -5
- package/lib/commonjs/docs/classes/types.ZelloOutgoingVoiceMessage.html +7 -7
- package/lib/commonjs/docs/classes/types.ZelloRecentEntry.html +7 -7
- package/lib/commonjs/docs/classes/types.ZelloTextMessage.html +7 -7
- package/lib/commonjs/docs/classes/types.ZelloUser.html +8 -8
- package/lib/commonjs/docs/enums/events.ZelloEvent.html +83 -67
- package/lib/commonjs/docs/enums/types.ZelloAccountStatus.html +3 -3
- package/lib/commonjs/docs/enums/types.ZelloChannelAlertLevel.html +3 -3
- package/lib/commonjs/docs/enums/types.ZelloChannelConnectionStatus.html +2 -2
- package/lib/commonjs/docs/enums/types.ZelloConnectionError.html +2 -2
- package/lib/commonjs/docs/enums/types.ZelloConnectionState.html +2 -2
- package/lib/commonjs/docs/enums/types.ZelloContactType.html +2 -2
- package/lib/commonjs/docs/enums/types.ZelloDispatchCallStatus.html +6 -0
- package/lib/commonjs/docs/enums/types.ZelloOutgoingVoiceMessageError.html +2 -2
- package/lib/commonjs/docs/enums/types.ZelloOutgoingVoiceMessageState.html +2 -2
- package/lib/commonjs/docs/enums/types.ZelloRecentEntryType.html +2 -2
- package/lib/commonjs/docs/enums/types.ZelloUserStatus.html +5 -5
- package/lib/commonjs/docs/index.html +10 -9
- package/lib/commonjs/docs/modules/events.html +1 -1
- package/lib/commonjs/docs/modules/index.html +7 -3
- package/lib/commonjs/docs/modules/sdk.html +1 -1
- package/lib/commonjs/docs/modules/types.html +5 -1
- package/lib/commonjs/docs/types/types.ZelloChannelOptions.html +1 -1
- package/lib/commonjs/docs/types/types.ZelloConfig.html +4 -3
- package/lib/commonjs/docs/types/types.ZelloContact.html +1 -1
- package/lib/commonjs/docs/types/types.ZelloCredentials.html +2 -2
- package/lib/commonjs/docs/types/types.ZelloHistoryMessage.html +1 -1
- package/lib/commonjs/docs/types/types.ZelloMessage.html +1 -1
- package/lib/commonjs/events/index.js +5 -0
- package/lib/commonjs/events/index.js.map +1 -1
- package/lib/commonjs/sdk/index.js +64 -2
- package/lib/commonjs/sdk/index.js.map +1 -1
- package/lib/commonjs/types/index.js +63 -1
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/commonjs/utils/index.js +34 -1
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/module/docs/assets/highlight.css +13 -6
- package/lib/module/docs/assets/main.js +1 -1
- package/lib/module/docs/assets/main.js.map +1 -1
- package/lib/module/docs/assets/navigation.js +1 -1
- package/lib/module/docs/assets/navigation.js.map +1 -1
- package/lib/module/docs/assets/search.js +1 -1
- package/lib/module/docs/assets/search.js.map +1 -1
- package/lib/module/docs/classes/sdk.Zello.html +48 -40
- package/lib/module/docs/classes/types.ZelloAlertMessage.html +7 -7
- package/lib/module/docs/classes/types.ZelloChannel.html +8 -8
- package/lib/module/docs/classes/types.ZelloChannelUser.html +2 -2
- package/lib/module/docs/classes/types.ZelloConsoleSettings.html +5 -0
- package/lib/module/docs/classes/types.ZelloDispatchCall.html +7 -0
- package/lib/module/docs/classes/types.ZelloDispatchChannel.html +19 -0
- package/lib/module/docs/classes/types.ZelloHistoryAlertMessage.html +8 -8
- package/lib/module/docs/classes/types.ZelloHistoryImageMessage.html +7 -7
- package/lib/module/docs/classes/types.ZelloHistoryLocationMessage.html +11 -11
- package/lib/module/docs/classes/types.ZelloHistoryTextMessage.html +8 -8
- package/lib/module/docs/classes/types.ZelloHistoryVoiceMessage.html +8 -8
- package/lib/module/docs/classes/types.ZelloImageMessage.html +8 -8
- package/lib/module/docs/classes/types.ZelloIncomingEmergency.html +7 -7
- package/lib/module/docs/classes/types.ZelloIncomingVoiceMessage.html +6 -6
- package/lib/module/docs/classes/types.ZelloLocationMessage.html +10 -10
- package/lib/module/docs/classes/types.ZelloOutgoingEmergency.html +5 -5
- package/lib/module/docs/classes/types.ZelloOutgoingVoiceMessage.html +7 -7
- package/lib/module/docs/classes/types.ZelloRecentEntry.html +7 -7
- package/lib/module/docs/classes/types.ZelloTextMessage.html +7 -7
- package/lib/module/docs/classes/types.ZelloUser.html +8 -8
- package/lib/module/docs/enums/events.ZelloEvent.html +83 -67
- package/lib/module/docs/enums/types.ZelloAccountStatus.html +3 -3
- package/lib/module/docs/enums/types.ZelloChannelAlertLevel.html +3 -3
- package/lib/module/docs/enums/types.ZelloChannelConnectionStatus.html +2 -2
- package/lib/module/docs/enums/types.ZelloConnectionError.html +2 -2
- package/lib/module/docs/enums/types.ZelloConnectionState.html +2 -2
- package/lib/module/docs/enums/types.ZelloContactType.html +2 -2
- package/lib/module/docs/enums/types.ZelloDispatchCallStatus.html +6 -0
- package/lib/module/docs/enums/types.ZelloOutgoingVoiceMessageError.html +2 -2
- package/lib/module/docs/enums/types.ZelloOutgoingVoiceMessageState.html +2 -2
- package/lib/module/docs/enums/types.ZelloRecentEntryType.html +2 -2
- package/lib/module/docs/enums/types.ZelloUserStatus.html +5 -5
- package/lib/module/docs/index.html +10 -9
- package/lib/module/docs/modules/events.html +1 -1
- package/lib/module/docs/modules/index.html +7 -3
- package/lib/module/docs/modules/sdk.html +1 -1
- package/lib/module/docs/modules/types.html +5 -1
- package/lib/module/docs/types/types.ZelloChannelOptions.html +1 -1
- package/lib/module/docs/types/types.ZelloConfig.html +4 -3
- package/lib/module/docs/types/types.ZelloContact.html +1 -1
- package/lib/module/docs/types/types.ZelloCredentials.html +2 -2
- package/lib/module/docs/types/types.ZelloHistoryMessage.html +1 -1
- package/lib/module/docs/types/types.ZelloMessage.html +1 -1
- package/lib/module/events/index.js +5 -0
- package/lib/module/events/index.js.map +1 -1
- package/lib/module/sdk/index.js +66 -2
- package/lib/module/sdk/index.js.map +1 -1
- package/lib/module/types/index.js +66 -0
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/utils/index.js +33 -2
- package/lib/module/utils/index.js.map +1 -1
- package/lib/typescript/commonjs/src/events/index.d.ts +28 -2
- package/lib/typescript/commonjs/src/events/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/sdk/index.d.ts +16 -1
- package/lib/typescript/commonjs/src/sdk/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/index.d.ts +47 -0
- package/lib/typescript/commonjs/src/types/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/index.d.ts +3 -1
- package/lib/typescript/commonjs/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/module/src/events/index.d.ts +28 -2
- package/lib/typescript/module/src/events/index.d.ts.map +1 -1
- package/lib/typescript/module/src/sdk/index.d.ts +16 -1
- package/lib/typescript/module/src/sdk/index.d.ts.map +1 -1
- package/lib/typescript/module/src/types/index.d.ts +47 -0
- package/lib/typescript/module/src/types/index.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/index.d.ts +3 -1
- package/lib/typescript/module/src/utils/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/react-native-zello-sdk.podspec +1 -1
- package/src/events/index.ts +27 -1
- package/src/sdk/index.ts +71 -2
- package/src/types/index.ts +69 -0
- package/src/utils/index.ts +61 -11
package/README.md
CHANGED
|
@@ -23,7 +23,20 @@ npm install @zelloptt/react-native-zello-sdk
|
|
|
23
23
|
|
|
24
24
|
### iOS
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
Before getting started, please reference the iOS Installation Guide.
|
|
27
|
+
|
|
28
|
+
#### Troubleshooting
|
|
29
|
+
|
|
30
|
+
While setting up your Notification Service Extension, you may receive an error:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
Cycle inside YourApp; building could produce unreliable results.
|
|
34
|
+
Cycle details:
|
|
35
|
+
→ Target ‘YourApp’
|
|
36
|
+
○ That command depends on command in Target ‘YourApp’: script phase “[CP-User] [RNFB] Core Configuration”
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
If you receive the above error, you should move the `Build Phases` phase named `Embed Foundation Extensions` to higher up in the order.
|
|
27
40
|
|
|
28
41
|
### Android
|
|
29
42
|
|
package/android/build.gradle
CHANGED
|
@@ -102,6 +102,8 @@ repositories {
|
|
|
102
102
|
|
|
103
103
|
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
104
104
|
|
|
105
|
+
def zelloSdkVersion = "0.4.0"
|
|
106
|
+
|
|
105
107
|
dependencies {
|
|
106
108
|
// For < 0.71, this will be from the local maven repo
|
|
107
109
|
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
|
|
@@ -110,9 +112,9 @@ dependencies {
|
|
|
110
112
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
111
113
|
|
|
112
114
|
// Required Dependencies to use the Zello SDK
|
|
113
|
-
api("com.zello:sdk
|
|
114
|
-
api("com.zello:zello
|
|
115
|
-
api("com.zello:core
|
|
115
|
+
api("com.zello:sdk:$zelloSdkVersion")
|
|
116
|
+
api("com.zello:zello:$zelloSdkVersion")
|
|
117
|
+
api("com.zello:core:$zelloSdkVersion") {
|
|
116
118
|
exclude module: "unspecified"
|
|
117
119
|
}
|
|
118
120
|
implementation(platform("com.google.firebase:firebase-bom:33.1.2"))
|
|
@@ -17,6 +17,7 @@ import com.zello.sdk.ZelloAlertMessage
|
|
|
17
17
|
import com.zello.sdk.ZelloConnectionError
|
|
18
18
|
import com.zello.sdk.ZelloContact
|
|
19
19
|
import com.zello.sdk.ZelloCredentials
|
|
20
|
+
import com.zello.sdk.ZelloDispatchChannel
|
|
20
21
|
import com.zello.sdk.ZelloHistoryImageMessage
|
|
21
22
|
import com.zello.sdk.ZelloHistoryVoiceMessage
|
|
22
23
|
import com.zello.sdk.ZelloImageMessage
|
|
@@ -26,6 +27,8 @@ import com.zello.sdk.ZelloLocationMessage
|
|
|
26
27
|
import com.zello.sdk.ZelloOutgoingEmergency
|
|
27
28
|
import com.zello.sdk.ZelloOutgoingVoiceMessage
|
|
28
29
|
import com.zello.sdk.ZelloRecentEntry
|
|
30
|
+
import com.zello.sdk.ZelloConsoleSettings
|
|
31
|
+
import com.zello.sdk.ZelloState
|
|
29
32
|
import com.zello.sdk.ZelloTextMessage
|
|
30
33
|
import javax.inject.Inject
|
|
31
34
|
|
|
@@ -177,6 +180,16 @@ class ZelloAndroidSdkModule @Inject constructor(
|
|
|
177
180
|
}
|
|
178
181
|
}
|
|
179
182
|
|
|
183
|
+
@ReactMethod
|
|
184
|
+
fun endDispatchCall(channelName: String) {
|
|
185
|
+
val dispatchChannel = zello.getChannel(channelName) as? ZelloDispatchChannel ?: return
|
|
186
|
+
val call = dispatchChannel.currentCall ?: return
|
|
187
|
+
zello.endDispatchCall(call, dispatchChannel)
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
override fun onStateChanged(sdk: Zello, state: ZelloState) {
|
|
191
|
+
}
|
|
192
|
+
|
|
180
193
|
override fun onConnectFailed(zello: Zello, error: ZelloConnectionError) {
|
|
181
194
|
sendEvent(reactApplicationContext, "onConnectFailed", Arguments.createMap().apply {
|
|
182
195
|
putString("error", error.toString())
|
|
@@ -429,6 +442,38 @@ class ZelloAndroidSdkModule @Inject constructor(
|
|
|
429
442
|
sendEvent(reactApplicationContext, "onHistoryUpdated", null)
|
|
430
443
|
}
|
|
431
444
|
|
|
445
|
+
override fun onConsoleSettingsChanged(zello: Zello, settings: ZelloConsoleSettings) {
|
|
446
|
+
sendEvent(reactApplicationContext, "onConsoleSettingsChanged", ZelloAndroidSdkModuleHelper.consoleSettingsToWritableMap(settings))
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
override fun onDispatchCallPending(zello: Zello, channel: ZelloDispatchChannel, call: ZelloDispatchChannel.Call) {
|
|
450
|
+
sendEvent(reactApplicationContext, "onDispatchCallPending", Arguments.createMap().apply {
|
|
451
|
+
putMap("call", ZelloAndroidSdkModuleHelper.callToWritableMap(call))
|
|
452
|
+
putMap("channel", ZelloAndroidSdkModuleHelper.sdkContactToWritableMap(channel))
|
|
453
|
+
})
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
override fun onDispatchCallActive(zello: Zello, channel: ZelloDispatchChannel, call: ZelloDispatchChannel.Call) {
|
|
457
|
+
sendEvent(reactApplicationContext, "onDispatchCallActive", Arguments.createMap().apply {
|
|
458
|
+
putMap("call", ZelloAndroidSdkModuleHelper.callToWritableMap(call))
|
|
459
|
+
putMap("channel", ZelloAndroidSdkModuleHelper.sdkContactToWritableMap(channel))
|
|
460
|
+
})
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
override fun onDispatchCallTransferred(zello: Zello, channel: ZelloDispatchChannel, call: ZelloDispatchChannel.Call) {
|
|
464
|
+
sendEvent(reactApplicationContext, "onDispatchCallTransferred", Arguments.createMap().apply {
|
|
465
|
+
putMap("call", ZelloAndroidSdkModuleHelper.callToWritableMap(call))
|
|
466
|
+
putMap("channel", ZelloAndroidSdkModuleHelper.sdkContactToWritableMap(channel))
|
|
467
|
+
})
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
override fun onDispatchCallEnded(zello: Zello, channel: ZelloDispatchChannel, call: ZelloDispatchChannel.Call) {
|
|
471
|
+
sendEvent(reactApplicationContext, "onDispatchCallEnded", Arguments.createMap().apply {
|
|
472
|
+
putMap("call", ZelloAndroidSdkModuleHelper.callToWritableMap(call))
|
|
473
|
+
putMap("channel", ZelloAndroidSdkModuleHelper.sdkContactToWritableMap(channel))
|
|
474
|
+
})
|
|
475
|
+
}
|
|
476
|
+
|
|
432
477
|
private fun sendEvent(reactContext: ReactContext, name: String, params: WritableMap?) {
|
|
433
478
|
reactContext
|
|
434
479
|
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
|
@@ -7,7 +7,9 @@ import com.facebook.react.bridge.WritableMap
|
|
|
7
7
|
import com.facebook.react.bridge.WritableNativeArray
|
|
8
8
|
import com.facebook.react.bridge.WritableNativeMap
|
|
9
9
|
import com.zello.sdk.ZelloChannel
|
|
10
|
+
import com.zello.sdk.ZelloConsoleSettings
|
|
10
11
|
import com.zello.sdk.ZelloContact
|
|
12
|
+
import com.zello.sdk.ZelloDispatchChannel
|
|
11
13
|
import com.zello.sdk.ZelloHistoryAlertMessage
|
|
12
14
|
import com.zello.sdk.ZelloHistoryImageMessage
|
|
13
15
|
import com.zello.sdk.ZelloHistoryLocationMessage
|
|
@@ -64,6 +66,12 @@ object ZelloAndroidSdkModuleHelper {
|
|
|
64
66
|
putBoolean("allowTextMessages", options.allowTextMessages)
|
|
65
67
|
putBoolean("allowLocations", options.allowLocations)
|
|
66
68
|
})
|
|
69
|
+
if (contact is ZelloDispatchChannel) {
|
|
70
|
+
putBoolean("isDispatchChannel", true)
|
|
71
|
+
contact.currentCall?.let { call ->
|
|
72
|
+
putMap("currentCall", callToWritableMap(call))
|
|
73
|
+
}
|
|
74
|
+
}
|
|
67
75
|
}
|
|
68
76
|
|
|
69
77
|
else -> WritableNativeMap()
|
|
@@ -195,4 +203,19 @@ object ZelloAndroidSdkModuleHelper {
|
|
|
195
203
|
putString("address", message.address)
|
|
196
204
|
}
|
|
197
205
|
}
|
|
206
|
+
|
|
207
|
+
fun consoleSettingsToWritableMap(settings: ZelloConsoleSettings): WritableMap {
|
|
208
|
+
return Arguments.createMap().apply {
|
|
209
|
+
putBoolean("allowNonDispatchersToEndCalls", settings.allowNonDispatchersToEndCalls)
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
fun callToWritableMap(call: ZelloDispatchChannel.Call): WritableMap {
|
|
214
|
+
return Arguments.createMap().apply {
|
|
215
|
+
putInt("id", call.id.toInt())
|
|
216
|
+
putString("status", call.status.toString())
|
|
217
|
+
putString("dispatcher", call.dispatcher)
|
|
218
|
+
putString("timestamp", call.timestamp.toString())
|
|
219
|
+
}
|
|
220
|
+
}
|
|
198
221
|
}
|
|
@@ -13,7 +13,7 @@ extension ZelloContact {
|
|
|
13
13
|
|
|
14
14
|
extension ZelloChannel {
|
|
15
15
|
var jsonDictionary: [AnyHashable: Any] {
|
|
16
|
-
|
|
16
|
+
var body: [AnyHashable: Any] = [
|
|
17
17
|
"name": name,
|
|
18
18
|
"isChannel": true,
|
|
19
19
|
"isMuted": isMuted,
|
|
@@ -27,8 +27,13 @@ extension ZelloChannel {
|
|
|
27
27
|
"allowAlerts": channelOptions.allowAlerts,
|
|
28
28
|
"allowTextMessages": channelOptions.allowTextMessages,
|
|
29
29
|
"allowLocations": channelOptions.allowLocations
|
|
30
|
-
]
|
|
30
|
+
],
|
|
31
|
+
"isDispatchChannel": dispatchInfo != nil
|
|
31
32
|
]
|
|
33
|
+
if let currentCall = dispatchInfo?.currentCall {
|
|
34
|
+
body["currentCall"] = currentCall.jsonDictionary
|
|
35
|
+
}
|
|
36
|
+
return body
|
|
32
37
|
}
|
|
33
38
|
}
|
|
34
39
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import ZelloSDK
|
|
2
|
+
|
|
3
|
+
extension ZelloDispatchCall {
|
|
4
|
+
var jsonDictionary: [AnyHashable: Any] {
|
|
5
|
+
var body: [AnyHashable: Any] = [
|
|
6
|
+
"status": status.rawValue,
|
|
7
|
+
]
|
|
8
|
+
if let dispatcher = dispatcher {
|
|
9
|
+
body["dispatcher"] = dispatcher
|
|
10
|
+
}
|
|
11
|
+
return body
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -279,7 +279,43 @@ extension ZelloIOSSdkModule: Zello.Delegate {
|
|
|
279
279
|
sendSdkEvent(withName: "onHistoryPlaybackStarted", body: message.jsonDictionary)
|
|
280
280
|
}
|
|
281
281
|
|
|
282
|
-
func zello(_ zello: Zello,
|
|
282
|
+
func zello(_ zello: Zello, didFinishHistoryPlayback message: ZelloHistoryVoiceMessage) {
|
|
283
283
|
sendSdkEvent(withName: "onHistoryPlaybackStopped", body: message.jsonDictionary)
|
|
284
284
|
}
|
|
285
|
+
|
|
286
|
+
func zello(_ zello: Zello, callDidBecomePending call: ZelloDispatchCall, on channel: ZelloChannel) {
|
|
287
|
+
let body: [AnyHashable: Any] = [
|
|
288
|
+
"call": call.jsonDictionary,
|
|
289
|
+
"channel": channel.jsonDictionary
|
|
290
|
+
]
|
|
291
|
+
sendSdkEvent(withName: "onDispatchCallPending", body: body)
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
func zello(_ zello: Zello, callDidEnd call: ZelloDispatchCall, on channel: ZelloChannel) {
|
|
295
|
+
let body: [AnyHashable: Any] = [
|
|
296
|
+
"call": call.jsonDictionary,
|
|
297
|
+
"channel": channel.jsonDictionary
|
|
298
|
+
]
|
|
299
|
+
sendSdkEvent(withName: "onDispatchCallEnded", body: body)
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
func zello(_ zello: Zello, callDidBecomeActive call: ZelloDispatchCall, on channel: ZelloChannel) {
|
|
303
|
+
let body: [AnyHashable: Any] = [
|
|
304
|
+
"call": call.jsonDictionary,
|
|
305
|
+
"channel": channel.jsonDictionary
|
|
306
|
+
]
|
|
307
|
+
sendSdkEvent(withName: "onDispatchCallActive", body: body)
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
func zello(_ zello: Zello, callDidTransfer call: ZelloDispatchCall, on channel: ZelloChannel, toDispatcherNamed dispatcher: String) {
|
|
311
|
+
let body: [AnyHashable: Any] = [
|
|
312
|
+
"call": call.jsonDictionary,
|
|
313
|
+
"channel": channel.jsonDictionary
|
|
314
|
+
]
|
|
315
|
+
sendSdkEvent(withName: "onDispatchCallTransferred", body: body)
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
func zello(_ zello: Zello, didUpdate consoleSettings: ZelloConsoleSettings) {
|
|
319
|
+
sendSdkEvent(withName: "onConsoleSettingsChanged", body: consoleSettings.jsonDictionary)
|
|
320
|
+
}
|
|
285
321
|
}
|
|
@@ -12,8 +12,13 @@ import ZelloSDK
|
|
|
12
12
|
zello.delegate = self
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
@objc func configure(_ isDebugBuild: Bool) {
|
|
16
|
-
|
|
15
|
+
@objc func configure(_ isDebugBuild: Bool, appGroup: String) {
|
|
16
|
+
var group: String? = appGroup
|
|
17
|
+
if appGroup.isEmpty {
|
|
18
|
+
group = nil
|
|
19
|
+
}
|
|
20
|
+
var configuration = ZelloConfiguration(appGroup: group)
|
|
21
|
+
configuration.pushNotificationEnvironment = isDebugBuild ? .development : .production
|
|
17
22
|
}
|
|
18
23
|
|
|
19
24
|
@objc func connect(_ network: String, username: String, password: String) {
|
|
@@ -189,6 +194,16 @@ import ZelloSDK
|
|
|
189
194
|
}
|
|
190
195
|
callback([base64String])
|
|
191
196
|
}
|
|
197
|
+
|
|
198
|
+
@objc func endDispatchCall(_ channelName: String) {
|
|
199
|
+
guard
|
|
200
|
+
let dispatchChannel = zello.channel(named: channelName),
|
|
201
|
+
let call = dispatchChannel.dispatchInfo?.currentCall
|
|
202
|
+
else {
|
|
203
|
+
return
|
|
204
|
+
}
|
|
205
|
+
zello.end(call, on: dispatchChannel)
|
|
206
|
+
}
|
|
192
207
|
}
|
|
193
208
|
|
|
194
209
|
extension ZelloIOSSdkModule {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
@interface RCT_EXTERN_MODULE(ZelloIOSSdkModule, NSObject)
|
|
4
4
|
|
|
5
|
-
RCT_EXTERN_METHOD(configure:(BOOL)isDebugBuild)
|
|
5
|
+
RCT_EXTERN_METHOD(configure:(BOOL)isDebugBuild appGroup:(NSString *)appGroup)
|
|
6
6
|
|
|
7
7
|
RCT_EXTERN_METHOD(connect:(NSString *)network username:(NSString *)username password:(NSString *)password)
|
|
8
8
|
RCT_EXTERN_METHOD(disconnect)
|
|
@@ -41,4 +41,6 @@ RCT_EXTERN_METHOD(stopHistoryMessagePlayback)
|
|
|
41
41
|
|
|
42
42
|
RCT_EXTERN_METHOD(getHistoryImageData:(NSString *)historyId contactName:(NSString *)contactName isChannel:(BOOL)isChannel callback:(RCTResponseSenderBlock)callback)
|
|
43
43
|
|
|
44
|
+
RCT_EXTERN_METHOD(endDispatchCall:(NSString *)channelName)
|
|
45
|
+
|
|
44
46
|
@end
|
|
@@ -7,12 +7,14 @@
|
|
|
7
7
|
--dark-hl-2: #CE9178;
|
|
8
8
|
--light-hl-3: #001080;
|
|
9
9
|
--dark-hl-3: #9CDCFE;
|
|
10
|
-
--light-hl-4: #
|
|
11
|
-
--dark-hl-4: #
|
|
12
|
-
--light-hl-5: #
|
|
13
|
-
--dark-hl-5: #
|
|
14
|
-
--light-hl-6: #
|
|
15
|
-
--dark-hl-6: #
|
|
10
|
+
--light-hl-4: #000000;
|
|
11
|
+
--dark-hl-4: #C8C8C8;
|
|
12
|
+
--light-hl-5: #0000FF;
|
|
13
|
+
--dark-hl-5: #569CD6;
|
|
14
|
+
--light-hl-6: #0070C1;
|
|
15
|
+
--dark-hl-6: #4FC1FF;
|
|
16
|
+
--light-hl-7: #008000;
|
|
17
|
+
--dark-hl-7: #6A9955;
|
|
16
18
|
--light-code-background: #FFFFFF;
|
|
17
19
|
--dark-code-background: #1E1E1E;
|
|
18
20
|
}
|
|
@@ -25,6 +27,7 @@
|
|
|
25
27
|
--hl-4: var(--light-hl-4);
|
|
26
28
|
--hl-5: var(--light-hl-5);
|
|
27
29
|
--hl-6: var(--light-hl-6);
|
|
30
|
+
--hl-7: var(--light-hl-7);
|
|
28
31
|
--code-background: var(--light-code-background);
|
|
29
32
|
} }
|
|
30
33
|
|
|
@@ -36,6 +39,7 @@
|
|
|
36
39
|
--hl-4: var(--dark-hl-4);
|
|
37
40
|
--hl-5: var(--dark-hl-5);
|
|
38
41
|
--hl-6: var(--dark-hl-6);
|
|
42
|
+
--hl-7: var(--dark-hl-7);
|
|
39
43
|
--code-background: var(--dark-code-background);
|
|
40
44
|
} }
|
|
41
45
|
|
|
@@ -47,6 +51,7 @@
|
|
|
47
51
|
--hl-4: var(--light-hl-4);
|
|
48
52
|
--hl-5: var(--light-hl-5);
|
|
49
53
|
--hl-6: var(--light-hl-6);
|
|
54
|
+
--hl-7: var(--light-hl-7);
|
|
50
55
|
--code-background: var(--light-code-background);
|
|
51
56
|
}
|
|
52
57
|
|
|
@@ -58,6 +63,7 @@
|
|
|
58
63
|
--hl-4: var(--dark-hl-4);
|
|
59
64
|
--hl-5: var(--dark-hl-5);
|
|
60
65
|
--hl-6: var(--dark-hl-6);
|
|
66
|
+
--hl-7: var(--dark-hl-7);
|
|
61
67
|
--code-background: var(--dark-code-background);
|
|
62
68
|
}
|
|
63
69
|
|
|
@@ -68,4 +74,5 @@
|
|
|
68
74
|
.hl-4 { color: var(--hl-4); }
|
|
69
75
|
.hl-5 { color: var(--hl-5); }
|
|
70
76
|
.hl-6 { color: var(--hl-6); }
|
|
77
|
+
.hl-7 { color: var(--hl-7); }
|
|
71
78
|
pre, code { background: var(--code-background); }
|
|
@@ -1403,7 +1403,7 @@ window.translations = {
|
|
|
1403
1403
|
function be(t, e, n) {
|
|
1404
1404
|
if (t.path) {
|
|
1405
1405
|
let r = e.appendChild(document.createElement("a"));
|
|
1406
|
-
r.href = K + t.path, n && (r.className = n), location.pathname === r.pathname && r.classList.add("current"), t.kind && (r.innerHTML = `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" class="tsd-kind-icon"><use href="#icon-${t.kind}"></use></svg>`), r.appendChild(document.createElement("span")).textContent = t.text;
|
|
1406
|
+
r.href = K + t.path, n && (r.className = n), location.pathname === r.pathname && !r.href.includes("#") && r.classList.add("current"), t.kind && (r.innerHTML = `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" class="tsd-kind-icon"><use href="#icon-${t.kind}"></use></svg>`), r.appendChild(document.createElement("span")).textContent = t.text;
|
|
1407
1407
|
} else e.appendChild(document.createElement("span")).textContent = t.text;
|
|
1408
1408
|
}
|
|
1409
1409
|
G(X, "a[data-toggle]");
|