@moxtradeveloper/react-native-moxo-module 8.12.2 → 8.16.6

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.16.6"
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
@@ -196,7 +220,10 @@ class MoxoModuleModule(reactContext: ReactApplicationContext) :
196
220
  "registerNotification called and token is " + (if (deviceToken == null) "null" else "not null")
197
221
  )
198
222
  if (deviceToken != null) {
199
- MEPClient.registerNotification(deviceToken, object : ApiCallback<Void> {
223
+ MEPClient.registerNotification(
224
+ deviceToken,
225
+ null, null, null,
226
+ object : ApiCallback<Void> {
200
227
  override fun onCompleted(rlt: Void?) {
201
228
  Log.d(TAG, "registerNotification called and completed...")
202
229
  }
@@ -234,6 +261,7 @@ class MoxoModuleModule(reactContext: ReactApplicationContext) :
234
261
  var meetId = rlt.getValue(key)
235
262
  jsonObject.put("session_id", meetId)
236
263
  }
264
+
237
265
  else -> continue
238
266
  }
239
267
  }
@@ -256,6 +284,38 @@ class MoxoModuleModule(reactContext: ReactApplicationContext) :
256
284
  }
257
285
  }
258
286
 
287
+ @ReactMethod
288
+ fun showMeetRinger(sessionId: String, promise: Promise?) {
289
+ Log.d(TAG, "show meet ringer called with session id $sessionId")
290
+ if (!MEPClient.isLinked()) {
291
+ promise?.reject("-1", "Not linked")
292
+ return
293
+ }
294
+ if (sessionId.isEmpty()) {
295
+ promise?.reject("-1", "session id is empty!")
296
+ return
297
+ }
298
+ MEPClient.showMeetRinger(sessionId, object : ApiCallback<Void> {
299
+ override fun onCompleted(rlt: Void?) {
300
+ Log.d(TAG, "show meet ringer success ...")
301
+ promise?.resolve("Show meet ringer success")
302
+ }
303
+
304
+ override fun onError(errorCode: Int, errorMsg: String?) {
305
+ Log.w(TAG, "show meet ringer failed with $errorCode and $errorMsg ...")
306
+ promise?.reject("-1", "Show meet ringer failed with $errorCode and $errorMsg")
307
+ }
308
+ })
309
+ }
310
+
311
+ @ReactMethod
312
+ fun changeLanguage(lang: String) {
313
+ Log.d(TAG, "changeLanguage called with $lang ...")
314
+ if (lang.isNotEmpty()) {
315
+ MEPClient.changeLanguage(lang)
316
+ }
317
+ }
318
+
259
319
  private fun json2Intent(jsonObject: JSONObject?): Intent {
260
320
  var intent = Intent()
261
321
  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.16.6",
4
4
  "description": "Plugin for adding Moxtra services to react-native Apps.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -30,10 +30,10 @@
30
30
  "test": "jest",
31
31
  "typescript": "tsc --noEmit",
32
32
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
33
- "release": "release-it",
34
33
  "example": "yarn --cwd example",
35
34
  "bootstrap": "yarn example && yarn install && yarn example pods",
36
- "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build"
35
+ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build",
36
+ "doc":"typedoc ./src/index.tsx --skipErrorChecking"
37
37
  },
38
38
  "keywords": [
39
39
  "moxtra",
@@ -57,7 +57,6 @@
57
57
  },
58
58
  "devDependencies": {
59
59
  "@react-native-community/eslint-config": "^3.0.2",
60
- "@release-it/conventional-changelog": "^5.0.0",
61
60
  "@types/jest": "^28.1.2",
62
61
  "@types/react": "~17.0.21",
63
62
  "@types/react-native": "0.70.0",
@@ -71,10 +70,12 @@
71
70
  "react": "18.1.0",
72
71
  "react-native": "0.70.6",
73
72
  "react-native-builder-bob": "^0.20.0",
74
- "release-it": "^15.0.0",
75
73
  "typedoc": "^0.24.8",
76
74
  "typescript": "^4.5.2"
77
75
  },
76
+ "overrides": {
77
+ "semver": "^7.5.3"
78
+ },
78
79
  "resolutions": {
79
80
  "@types/react": "17.0.21"
80
81
  },
@@ -98,23 +99,6 @@
98
99
  "@commitlint/config-conventional"
99
100
  ]
100
101
  },
101
- "release-it": {
102
- "git": {
103
- "commitMessage": "chore: release ${version}",
104
- "tagName": "v${version}"
105
- },
106
- "npm": {
107
- "publish": true
108
- },
109
- "github": {
110
- "release": true
111
- },
112
- "plugins": {
113
- "@release-it/conventional-changelog": {
114
- "preset": "angular"
115
- }
116
- }
117
- },
118
102
  "eslintConfig": {
119
103
  "root": true,
120
104
  "extends": [
@@ -159,4 +143,4 @@
159
143
  ]
160
144
  ]
161
145
  }
162
- }
146
+ }
@@ -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.16.6'
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>