@moxtradeveloper/react-native-moxo-module 8.12.2 → 8.13.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.
@@ -148,7 +148,7 @@ dependencies {
148
148
  //noinspection GradleDynamicVersion
149
149
  implementation "com.facebook.react:react-native:+"
150
150
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
151
- implementation "com.moxtra:mep-sdk:8.12.2"
151
+ implementation "com.moxtra:mep-sdk:8.13.1"
152
152
  // From node_modules
153
153
  }
154
154
 
@@ -84,7 +84,31 @@ class MoxoModuleModule(reactContext: ReactApplicationContext) :
84
84
  }
85
85
  })
86
86
  }
87
+ }
88
+
89
+ @ReactMethod
90
+ fun unlink(keepNotification: Boolean) {
91
+ Log.d(TAG, "unlink called with keep notification $keepNotification")
92
+ val callback: ApiCallback<Void?> = object : ApiCallback<Void?> {
93
+ override fun onCompleted(rult: Void?) {
94
+ Log.d(TAG, "unlink successful...")
95
+ }
96
+
97
+ override fun onError(errorCode: Int, errorMsg: String) {
98
+ Log.w(TAG, "unlink failed with error code $errorCode and error message $errorMsg ...")
99
+ }
100
+ }
101
+ if (keepNotification) {
102
+ MEPClient.localUnlink(callback)
103
+ } else {
104
+ MEPClient.unlink(callback)
105
+ }
106
+ }
87
107
 
108
+ @ReactMethod
109
+ fun getUnreadMessageCount(options: ReadableMap?, promise: Promise?) {
110
+ var unreadCount = MEPClient.getUnreadMessageCount()
111
+ promise?.resolve(unreadCount)
88
112
  }
89
113
 
90
114
  @ReactMethod
@@ -234,6 +258,7 @@ class MoxoModuleModule(reactContext: ReactApplicationContext) :
234
258
  var meetId = rlt.getValue(key)
235
259
  jsonObject.put("session_id", meetId)
236
260
  }
261
+
237
262
  else -> continue
238
263
  }
239
264
  }
@@ -256,6 +281,38 @@ class MoxoModuleModule(reactContext: ReactApplicationContext) :
256
281
  }
257
282
  }
258
283
 
284
+ @ReactMethod
285
+ fun showMeetRinger(sessionId: String, promise: Promise?) {
286
+ Log.d(TAG, "show meet ringer called with session id $sessionId")
287
+ if (!MEPClient.isLinked()) {
288
+ promise?.reject("-1", "Not linked")
289
+ return
290
+ }
291
+ if (sessionId.isEmpty()) {
292
+ promise?.reject("-1", "session id is empty!")
293
+ return
294
+ }
295
+ MEPClient.showMeetRinger(sessionId, object : ApiCallback<Void> {
296
+ override fun onCompleted(rlt: Void?) {
297
+ Log.d(TAG, "show meet ringer success ...")
298
+ promise?.resolve("Show meet ringer success")
299
+ }
300
+
301
+ override fun onError(errorCode: Int, errorMsg: String?) {
302
+ Log.w(TAG, "show meet ringer failed with $errorCode and $errorMsg ...")
303
+ promise?.reject("-1", "Show meet ringer failed with $errorCode and $errorMsg")
304
+ }
305
+ })
306
+ }
307
+
308
+ @ReactMethod
309
+ fun changeLanguage(lang: String) {
310
+ Log.d(TAG, "changeLanguage called with $lang ...")
311
+ if (lang.isNotEmpty()) {
312
+ MEPClient.changeLanguage(lang)
313
+ }
314
+ }
315
+
259
316
  private fun json2Intent(jsonObject: JSONObject?): Intent {
260
317
  var intent = Intent()
261
318
  var keys = jsonObject?.keys();
package/ios/MoxoModule.m CHANGED
@@ -8,6 +8,7 @@ RCT_EXTERN_METHOD(link:(NSString *)token
8
8
  RCT_EXTERN_METHOD(unlink:(BOOL)keepNotification)
9
9
  RCT_EXTERN_METHOD(showMEPWindow)
10
10
  RCT_EXTERN_METHOD(hideMEPWindow)
11
+ RCT_EXTERN_METHOD(changeLanguage:(NSString *)language)
11
12
  RCT_EXTERN_METHOD(openChat:(NSString *)chatId
12
13
  feedSequence:(NSNumber *__nonnull)feedSequence
13
14
  withResolver:(RCTPromiseResolveBlock)resolve
@@ -51,6 +51,13 @@ class MoxoModule: RCTEventEmitter, MEPClientDelegate {
51
51
  }
52
52
  }
53
53
 
54
+ @objc(changeLanguage:)
55
+ func changeLanguage(language:String) {
56
+ DispatchQueue.main.async {
57
+ MEPClient.sharedInstance().changeLanguage(language)
58
+ }
59
+ }
60
+
54
61
  @objc(openChat:feedSequence:withResolver:withRejecter:)
55
62
  func openChat(chatId:String,feedSequence:NSNumber,resolve:@escaping RCTPromiseResolveBlock, reject:@escaping RCTPromiseRejectBlock) {
56
63
  DispatchQueue.main.async {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moxtradeveloper/react-native-moxo-module",
3
- "version": "8.12.2",
3
+ "version": "8.13.1",
4
4
  "description": "Plugin for adding Moxtra services to react-native Apps.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -33,7 +33,8 @@
33
33
  "release": "release-it",
34
34
  "example": "yarn --cwd example",
35
35
  "bootstrap": "yarn example && yarn install && yarn example pods",
36
- "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build"
36
+ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build",
37
+ "doc":"typedoc ./src/index.tsx --skipErrorChecking"
37
38
  },
38
39
  "keywords": [
39
40
  "moxtra",
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|
17
17
  s.public_header_files = 'ios/*.h'
18
18
  s.swift_version = '5.0'
19
19
  s.dependency "React-Core"
20
- s.dependency 'MEPSDK', '~> 8.12.1'
20
+ s.dependency 'MEPSDK', '~> 8.13.1'
21
21
 
22
22
  # Don't install the dependencies when we run `pod install` in the old architecture.
23
23
  if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
package/src/index.tsx CHANGED
@@ -68,6 +68,13 @@ export function hideMEPWindow() {
68
68
  return MoxoModule.hideMEPWindow();
69
69
  }
70
70
 
71
+ /**
72
+ * Change language, language code should follow ISO 639-1 standard.
73
+ */
74
+ export function changeLanguage(language: string) {
75
+ return MoxoModule.changeLanguage(language);
76
+ }
77
+
71
78
  /**
72
79
  * Open chat with chat Id and scroll to the specified feed
73
80
  * @param {string} chatId - Id of chat.
@@ -134,3 +141,11 @@ export function parseNotification(payload:object): Promise<object> {
134
141
  return MoxoModule.parseNotification(payload);
135
142
  }
136
143
 
144
+ /**
145
+ * Show meet ringer with session Id. For Android only.
146
+ * @param {string} sessionId - session Id
147
+ */
148
+ export function showMeetRinger(sessionId:string): Promise<object> {
149
+ return MoxoModule.showMeetRinger(sessionId);
150
+ }
151
+
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>IDEDidComputeMac32BitWarning</key>
6
- <true/>
7
- </dict>
8
- </plist>
@@ -1,14 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>SchemeUserState</key>
6
- <dict>
7
- <key>MoxoModule.xcscheme_^#shared#^_</key>
8
- <dict>
9
- <key>orderHint</key>
10
- <integer>0</integer>
11
- </dict>
12
- </dict>
13
- </dict>
14
- </plist>