@zelloptt/react-native-zello-sdk 1.0.0 → 1.0.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/android/src/main/java/com/zellosdk/ZelloAndroidSdkModule.kt +31 -22
- package/ios/Extensions/ZelloContact+Extension.swift +2 -0
- package/ios/Extensions/ZelloIOSSdkModule+Extension.swift +8 -5
- package/ios/ZelloIOSSdkModule.swift +43 -23
- package/ios/ZelloIOSSdkModuleBridge.m +11 -11
- package/lib/commonjs/docs/classes/sdk.Zello.html +48 -48
- 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.ZelloDispatchCall.html +4 -4
- package/lib/commonjs/docs/classes/types.ZelloDispatchChannel.html +9 -9
- package/lib/commonjs/docs/classes/types.ZelloGroupConversation.html +11 -11
- 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 +9 -9
- package/lib/commonjs/docs/classes/types.ZelloUserSupportedFeatures.html +3 -3
- package/lib/commonjs/docs/enums/events.ZelloEvent.html +95 -95
- package/lib/commonjs/docs/enums/types.ZelloAccountStatus.html +4 -4
- package/lib/commonjs/docs/enums/types.ZelloChannelAlertLevel.html +4 -4
- 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 +2 -2
- 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 +6 -6
- package/lib/commonjs/docs/modules/events.html +1 -1
- package/lib/commonjs/docs/modules/index.html +1 -1
- package/lib/commonjs/docs/modules/sdk.html +1 -1
- package/lib/commonjs/docs/modules/types.html +1 -1
- package/lib/commonjs/docs/types/types.ZelloChannelOptions.html +1 -1
- package/lib/commonjs/docs/types/types.ZelloConfig.html +1 -1
- package/lib/commonjs/docs/types/types.ZelloConsoleSettings.html +1 -1
- package/lib/commonjs/docs/types/types.ZelloContact.html +1 -1
- package/lib/commonjs/docs/types/types.ZelloCredentials.html +1 -1
- package/lib/commonjs/docs/types/types.ZelloHistoryMessage.html +1 -1
- package/lib/commonjs/docs/types/types.ZelloMessage.html +1 -1
- package/lib/commonjs/sdk/index.js +22 -33
- package/lib/commonjs/sdk/index.js.map +1 -1
- package/lib/module/docs/classes/sdk.Zello.html +48 -48
- 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.ZelloDispatchCall.html +4 -4
- package/lib/module/docs/classes/types.ZelloDispatchChannel.html +9 -9
- package/lib/module/docs/classes/types.ZelloGroupConversation.html +11 -11
- 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 +9 -9
- package/lib/module/docs/classes/types.ZelloUserSupportedFeatures.html +3 -3
- package/lib/module/docs/enums/events.ZelloEvent.html +95 -95
- package/lib/module/docs/enums/types.ZelloAccountStatus.html +4 -4
- package/lib/module/docs/enums/types.ZelloChannelAlertLevel.html +4 -4
- 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 +2 -2
- 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 +6 -6
- package/lib/module/docs/modules/events.html +1 -1
- package/lib/module/docs/modules/index.html +1 -1
- package/lib/module/docs/modules/sdk.html +1 -1
- package/lib/module/docs/modules/types.html +1 -1
- package/lib/module/docs/types/types.ZelloChannelOptions.html +1 -1
- package/lib/module/docs/types/types.ZelloConfig.html +1 -1
- package/lib/module/docs/types/types.ZelloConsoleSettings.html +1 -1
- package/lib/module/docs/types/types.ZelloContact.html +1 -1
- package/lib/module/docs/types/types.ZelloCredentials.html +1 -1
- package/lib/module/docs/types/types.ZelloHistoryMessage.html +1 -1
- package/lib/module/docs/types/types.ZelloMessage.html +1 -1
- package/lib/module/sdk/index.js +22 -33
- package/lib/module/sdk/index.js.map +1 -1
- package/lib/typescript/commonjs/src/sdk/index.d.ts.map +1 -1
- package/lib/typescript/module/src/sdk/index.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/sdk/index.ts +22 -33
|
@@ -61,8 +61,8 @@ class ZelloAndroidSdkModule @Inject constructor(
|
|
|
61
61
|
zello.disconnect()
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
@ReactMethod fun setSelectedContact(name: String,
|
|
65
|
-
val contact = (
|
|
64
|
+
@ReactMethod fun setSelectedContact(name: String, type: String) {
|
|
65
|
+
val contact = contactFrom(name, type) ?: return
|
|
66
66
|
zello.setSelectedContact(contact)
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -85,8 +85,8 @@ class ZelloAndroidSdkModule @Inject constructor(
|
|
|
85
85
|
zello.disconnectChannel(channel)
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
@ReactMethod fun startVoiceMessage(name: String,
|
|
89
|
-
val contact = (
|
|
88
|
+
@ReactMethod fun startVoiceMessage(name: String, type: String) {
|
|
89
|
+
val contact = contactFrom(name, type) ?: return
|
|
90
90
|
zello.startVoiceMessage(contact)
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -95,8 +95,8 @@ class ZelloAndroidSdkModule @Inject constructor(
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
@ReactMethod
|
|
98
|
-
fun sendImage(name: String,
|
|
99
|
-
val contact = (
|
|
98
|
+
fun sendImage(name: String, type: String, data: ReadableArray) {
|
|
99
|
+
val contact = contactFrom(name, type) ?: return
|
|
100
100
|
val byteArray = ByteArray(data.size())
|
|
101
101
|
for (i in 0 until data.size()) {
|
|
102
102
|
byteArray[i] = data.getInt(i).toByte()
|
|
@@ -105,20 +105,20 @@ class ZelloAndroidSdkModule @Inject constructor(
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
@ReactMethod
|
|
108
|
-
fun sendLocation(name: String,
|
|
109
|
-
val contact = (
|
|
108
|
+
fun sendLocation(name: String, type: String) {
|
|
109
|
+
val contact = contactFrom(name, type) ?: return
|
|
110
110
|
zello.sendLocation(contact)
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
@ReactMethod
|
|
114
|
-
fun sendText(name: String,
|
|
115
|
-
val contact = (
|
|
114
|
+
fun sendText(name: String, type: String, text: String) {
|
|
115
|
+
val contact = contactFrom(name, type) ?: return
|
|
116
116
|
zello.sendText(text, contact)
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
@ReactMethod
|
|
120
|
-
fun sendAlert(name: String,
|
|
121
|
-
val contact = (
|
|
120
|
+
fun sendAlert(name: String, type: String, text: String, level: String?) {
|
|
121
|
+
val contact = contactFrom(name, type) ?: return
|
|
122
122
|
val channelAlertLevel = when (level) {
|
|
123
123
|
"all" -> ZelloAlertMessage.ChannelLevel.ALL
|
|
124
124
|
"connected" -> ZelloAlertMessage.ChannelLevel.CONNECTED
|
|
@@ -133,14 +133,14 @@ class ZelloAndroidSdkModule @Inject constructor(
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
@ReactMethod
|
|
136
|
-
fun muteContact(name: String,
|
|
137
|
-
val contact = (
|
|
136
|
+
fun muteContact(name: String, type: String) {
|
|
137
|
+
val contact = contactFrom(name, type) ?: return
|
|
138
138
|
zello.muteContact(contact)
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
@ReactMethod
|
|
142
|
-
fun unmuteContact(name: String,
|
|
143
|
-
val contact = (
|
|
142
|
+
fun unmuteContact(name: String, type: String) {
|
|
143
|
+
val contact = contactFrom(name, type) ?: return
|
|
144
144
|
zello.unmuteContact(contact)
|
|
145
145
|
}
|
|
146
146
|
|
|
@@ -155,15 +155,15 @@ class ZelloAndroidSdkModule @Inject constructor(
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
@ReactMethod
|
|
158
|
-
fun getHistory(name: String,
|
|
159
|
-
val contact = (
|
|
158
|
+
fun getHistory(name: String, type: String, size: Int?, callback: Callback) {
|
|
159
|
+
val contact = contactFrom(name, type) ?: return
|
|
160
160
|
val messages = if (size != null) zello.getHistory(contact, size) else zello.getHistory(contact)
|
|
161
161
|
callback.invoke(ZelloAndroidSdkModuleHelper.historyMessagesToWritableArray(messages))
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
@ReactMethod
|
|
165
|
-
fun playHistoryMessage(historyId: String, contactName: String,
|
|
166
|
-
val contact = (
|
|
165
|
+
fun playHistoryMessage(historyId: String, contactName: String, type: String) {
|
|
166
|
+
val contact = contactFrom(name, type) ?: return
|
|
167
167
|
val message = zello.getHistoryMessage(historyId, contact) as? ZelloHistoryVoiceMessage ?: return
|
|
168
168
|
zello.playHistoryMessage(message)
|
|
169
169
|
}
|
|
@@ -174,8 +174,8 @@ class ZelloAndroidSdkModule @Inject constructor(
|
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
@ReactMethod
|
|
177
|
-
fun getImageDataForHistoryImageMessage(historyId: String, contactName: String,
|
|
178
|
-
val contact = (
|
|
177
|
+
fun getImageDataForHistoryImageMessage(historyId: String, contactName: String, type: String, callback: Callback) {
|
|
178
|
+
val contact = contactFrom(name, type) ?: return
|
|
179
179
|
val message = zello.getHistoryMessage(historyId, contact) as? ZelloHistoryImageMessage ?: return
|
|
180
180
|
zello.loadBitmapForHistoryImageMessage(message) {
|
|
181
181
|
callback.invoke(ZelloAndroidSdkModuleHelper.bitmapToBase64String(it))
|
|
@@ -539,6 +539,15 @@ class ZelloAndroidSdkModule @Inject constructor(
|
|
|
539
539
|
})
|
|
540
540
|
}
|
|
541
541
|
|
|
542
|
+
private fun contactFrom(name: String, type: String): ZelloContact? {
|
|
543
|
+
return when (type) {
|
|
544
|
+
"channel", "dispatchChannel" -> zello.getChannel(name)
|
|
545
|
+
"groupConversation" -> zello.getGroupConversation(name)
|
|
546
|
+
"user" -> zello.getUser(name)
|
|
547
|
+
else -> null
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
|
|
542
551
|
private fun sendEvent(reactContext: ReactContext, name: String, params: WritableMap?) {
|
|
543
552
|
reactContext
|
|
544
553
|
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
|
@@ -6,6 +6,8 @@ extension ZelloContact {
|
|
|
6
6
|
return user.jsonDictionary
|
|
7
7
|
} else if let channel = self.asZelloChannel() {
|
|
8
8
|
return channel.jsonDictionary
|
|
9
|
+
} else if let groupConversation = self.asZelloGroupConversation() {
|
|
10
|
+
return groupConversation.jsonDictionary
|
|
9
11
|
}
|
|
10
12
|
return [:]
|
|
11
13
|
}
|
|
@@ -18,11 +18,14 @@ extension ZelloIOSSdkModule: Zello.Delegate {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
func zelloDidUpdateContactList(_ zello: Zello) {
|
|
21
|
-
let users = zello.users.map {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
let
|
|
25
|
-
|
|
21
|
+
let users = zello.users.map { user in
|
|
22
|
+
user.jsonDictionary
|
|
23
|
+
}
|
|
24
|
+
let channels = zello.channels.map { channel in
|
|
25
|
+
channel.jsonDictionary
|
|
26
|
+
}
|
|
27
|
+
let groupConversations = zello.groupConversations.map { conversation in
|
|
28
|
+
conversation.jsonDictionary
|
|
26
29
|
}
|
|
27
30
|
var body: [AnyHashable: Any] = [
|
|
28
31
|
"users": users,
|
|
@@ -42,15 +42,15 @@ import ZelloSDK
|
|
|
42
42
|
zello.setAccountStatus(status: accountStatus)
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
@objc func selectContact(_ name: String,
|
|
46
|
-
guard let contact =
|
|
45
|
+
@objc func selectContact(_ name: String, contactType: String) {
|
|
46
|
+
guard let contact = contactFromType(contactType, name: name) else {
|
|
47
47
|
return
|
|
48
48
|
}
|
|
49
49
|
zello.setSelectedContact(contact: contact)
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
@objc func startVoiceMessage(_ name: String,
|
|
53
|
-
guard let contact =
|
|
52
|
+
@objc func startVoiceMessage(_ name: String, contactType: String) {
|
|
53
|
+
guard let contact = contactFromType(contactType, name: name) else {
|
|
54
54
|
return
|
|
55
55
|
}
|
|
56
56
|
zello.startVoiceMessage(contact: contact)
|
|
@@ -60,8 +60,8 @@ import ZelloSDK
|
|
|
60
60
|
zello.stopVoiceMessage()
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
@objc func sendImage(_ name: String,
|
|
64
|
-
guard let contact =
|
|
63
|
+
@objc func sendImage(_ name: String, contactType: String, data: [Int]) {
|
|
64
|
+
guard let contact = contactFromType(contactType, name: name) else {
|
|
65
65
|
return
|
|
66
66
|
}
|
|
67
67
|
let byteArray = data.map { UInt8($0) }
|
|
@@ -72,26 +72,26 @@ import ZelloSDK
|
|
|
72
72
|
zello.send(image, to: contact)
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
@objc func sendLocation(_ name: String,
|
|
76
|
-
guard let contact =
|
|
75
|
+
@objc func sendLocation(_ name: String, contactType: String) {
|
|
76
|
+
guard let contact = contactFromType(contactType, name: name) else {
|
|
77
77
|
return
|
|
78
78
|
}
|
|
79
79
|
zello.sendLocation(to: contact)
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
@objc func sendText(_ name: String,
|
|
83
|
-
guard let contact =
|
|
82
|
+
@objc func sendText(_ name: String, contactType: String, text: String) {
|
|
83
|
+
guard let contact = contactFromType(contactType, name: name) else {
|
|
84
84
|
return
|
|
85
85
|
}
|
|
86
86
|
zello.send(textMessage: text, to: contact)
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
@objc func sendAlert(_ name: String,
|
|
90
|
-
guard let contact =
|
|
89
|
+
@objc func sendAlert(_ name: String, contactType: String, text: String, level: String?) {
|
|
90
|
+
guard let contact = contactFromType(contactType, name: name) else {
|
|
91
91
|
return
|
|
92
92
|
}
|
|
93
93
|
var alertLevel: ZelloAlertMessage.ChannelLevel? = nil
|
|
94
|
-
if
|
|
94
|
+
if contact.isZelloChannel || contact.isZelloGroupConversation {
|
|
95
95
|
switch level {
|
|
96
96
|
case "all":
|
|
97
97
|
alertLevel = .all
|
|
@@ -136,15 +136,15 @@ import ZelloSDK
|
|
|
136
136
|
zello.submitReport()
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
@objc func muteContact(_ name: String,
|
|
140
|
-
guard let contact =
|
|
139
|
+
@objc func muteContact(_ name: String, contactType: String) {
|
|
140
|
+
guard let contact = contactFromType(contactType, name: name) else {
|
|
141
141
|
return
|
|
142
142
|
}
|
|
143
143
|
zello.muteContact(contact: contact)
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
@objc func unmuteContact(_ name: String,
|
|
147
|
-
guard let contact =
|
|
146
|
+
@objc func unmuteContact(_ name: String, contactType: String) {
|
|
147
|
+
guard let contact = contactFromType(contactType, name: name) else {
|
|
148
148
|
return
|
|
149
149
|
}
|
|
150
150
|
zello.unmuteContact(contact: contact)
|
|
@@ -160,8 +160,8 @@ import ZelloSDK
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
@objc func getHistory(_ name: String,
|
|
164
|
-
guard let contact =
|
|
163
|
+
@objc func getHistory(_ name: String, contactType: String, maxMessages: Int, callback: RCTResponseSenderBlock) {
|
|
164
|
+
guard let contact = contactFromType(contactType, name: name) else {
|
|
165
165
|
callback(nil)
|
|
166
166
|
return
|
|
167
167
|
}
|
|
@@ -182,9 +182,9 @@ import ZelloSDK
|
|
|
182
182
|
}])
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
@objc func playHistoryMessage(_ historyId: String, contactName: String,
|
|
185
|
+
@objc func playHistoryMessage(_ historyId: String, contactName: String, contactType: String) {
|
|
186
186
|
guard
|
|
187
|
-
let contact =
|
|
187
|
+
let contact = contactFromType(contactType, name: contactName),
|
|
188
188
|
let message = zello.getHistoryMessage(historyId, contact: contact) as? ZelloHistoryVoiceMessage
|
|
189
189
|
else {
|
|
190
190
|
return
|
|
@@ -196,9 +196,9 @@ import ZelloSDK
|
|
|
196
196
|
zello.stopHistoryMessagePlayback()
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
@objc func getHistoryImageData(_ historyId: String, contactName: String,
|
|
199
|
+
@objc func getHistoryImageData(_ historyId: String, contactName: String, contactType: String, callback: RCTResponseSenderBlock) {
|
|
200
200
|
guard
|
|
201
|
-
let contact =
|
|
201
|
+
let contact = contactFromType(contactType, name: contactName),
|
|
202
202
|
let message = zello.getHistoryMessage(historyId, contact: contact) as? ZelloHistoryImageMessage,
|
|
203
203
|
let image = zello.loadHistoryImage(for: message),
|
|
204
204
|
let base64String = image.base64String
|
|
@@ -248,6 +248,26 @@ import ZelloSDK
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
extension ZelloIOSSdkModule {
|
|
251
|
+
func contactFromType(_ type: String, name: String) -> ZelloContact? {
|
|
252
|
+
if type == "user" {
|
|
253
|
+
guard let user = zello.user(named: name) else {
|
|
254
|
+
return nil
|
|
255
|
+
}
|
|
256
|
+
return ZelloContact.user(user)
|
|
257
|
+
} else if type == "channel" || type == "dispatchChannel" {
|
|
258
|
+
guard let user = zello.channel(named: name) else {
|
|
259
|
+
return nil
|
|
260
|
+
}
|
|
261
|
+
return ZelloContact.channel(user)
|
|
262
|
+
} else if type == "groupConversation" {
|
|
263
|
+
guard let user = zello.conversation(named: name) else {
|
|
264
|
+
return nil
|
|
265
|
+
}
|
|
266
|
+
return ZelloContact.conversation(user)
|
|
267
|
+
}
|
|
268
|
+
return nil
|
|
269
|
+
}
|
|
270
|
+
|
|
251
271
|
func sendSdkEvent(withName name: String, body: [AnyHashable: Any]?) {
|
|
252
272
|
var eventBody = body ?? [:]
|
|
253
273
|
eventBody[eventName] = name
|
|
@@ -9,18 +9,18 @@ RCT_EXTERN_METHOD(disconnect)
|
|
|
9
9
|
|
|
10
10
|
RCT_EXTERN_METHOD(setAccountStatus:(NSString *)status)
|
|
11
11
|
|
|
12
|
-
RCT_EXTERN_METHOD(selectContact:(NSString *)name
|
|
12
|
+
RCT_EXTERN_METHOD(selectContact:(NSString *)name contactType:(NSString *)contactType)
|
|
13
13
|
|
|
14
|
-
RCT_EXTERN_METHOD(startVoiceMessage:(NSString *)name
|
|
14
|
+
RCT_EXTERN_METHOD(startVoiceMessage:(NSString *)name contactType:(NSString *)contactType)
|
|
15
15
|
RCT_EXTERN_METHOD(stopVoiceMessage)
|
|
16
16
|
|
|
17
|
-
RCT_EXTERN_METHOD(sendImage:(NSString *)name
|
|
17
|
+
RCT_EXTERN_METHOD(sendImage:(NSString *)name contactType:(NSString *)contactType data:(NSArray)data)
|
|
18
18
|
|
|
19
|
-
RCT_EXTERN_METHOD(sendLocation:(NSString *)name
|
|
19
|
+
RCT_EXTERN_METHOD(sendLocation:(NSString *)name contactType:(NSString *)contactType)
|
|
20
20
|
|
|
21
|
-
RCT_EXTERN_METHOD(sendText:(NSString *)name
|
|
21
|
+
RCT_EXTERN_METHOD(sendText:(NSString *)name contactType:(NSString *)contactType text:(NSString *)text)
|
|
22
22
|
|
|
23
|
-
RCT_EXTERN_METHOD(sendAlert:(NSString *)name
|
|
23
|
+
RCT_EXTERN_METHOD(sendAlert:(NSString *)name contactType:(NSString *)contactType text:(NSString *)text level:(NSString *)level)
|
|
24
24
|
|
|
25
25
|
RCT_EXTERN_METHOD(connectChannel:(NSString *)name)
|
|
26
26
|
RCT_EXTERN_METHOD(disconnectChannel:(NSString *)name)
|
|
@@ -30,19 +30,19 @@ RCT_EXTERN_METHOD(disconnectGroupConversation:(NSString *)name)
|
|
|
30
30
|
|
|
31
31
|
RCT_EXTERN_METHOD(submitProblemReport)
|
|
32
32
|
|
|
33
|
-
RCT_EXTERN_METHOD(muteContact:(NSString *)name
|
|
34
|
-
RCT_EXTERN_METHOD(unmuteContact:(NSString *)name
|
|
33
|
+
RCT_EXTERN_METHOD(muteContact:(NSString *)name contactType:(NSString *)contactType)
|
|
34
|
+
RCT_EXTERN_METHOD(unmuteContact:(NSString *)name contactType:(NSString *)contactType)
|
|
35
35
|
|
|
36
36
|
RCT_EXTERN_METHOD(startEmergency)
|
|
37
37
|
RCT_EXTERN_METHOD(stopEmergency)
|
|
38
38
|
|
|
39
|
-
RCT_EXTERN_METHOD(getHistory:(NSString *)name
|
|
39
|
+
RCT_EXTERN_METHOD(getHistory:(NSString *)name contactType:(NSString *)contactType maxMessages:(NSInteger)maxMessages callback:(RCTResponseSenderBlock)callback)
|
|
40
40
|
|
|
41
|
-
RCT_EXTERN_METHOD(playHistoryMessage:(NSString *)historyId contactName:(NSString *)contactName
|
|
41
|
+
RCT_EXTERN_METHOD(playHistoryMessage:(NSString *)historyId contactName:(NSString *)contactName contactType:(NSString *)contactType)
|
|
42
42
|
|
|
43
43
|
RCT_EXTERN_METHOD(stopHistoryMessagePlayback)
|
|
44
44
|
|
|
45
|
-
RCT_EXTERN_METHOD(getHistoryImageData:(NSString *)historyId contactName:(NSString *)contactName
|
|
45
|
+
RCT_EXTERN_METHOD(getHistoryImageData:(NSString *)historyId contactName:(NSString *)contactName contactType:(NSString *)contactType callback:(RCTResponseSenderBlock)callback)
|
|
46
46
|
|
|
47
47
|
RCT_EXTERN_METHOD(endDispatchCall:(NSString *)channelName)
|
|
48
48
|
|