com.cprot.ead 1.0.8135 → 1.0.8151

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.
@@ -87,5 +87,5 @@ project.afterEvaluate {
87
87
  dependencies {
88
88
  implementation("com.facebook.react:react-native:+")
89
89
  implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.24")
90
- implementation("com.cprot:ead:1.0.8135")
90
+ implementation("com.cprot:ead:1.0.8151")
91
91
  }
@@ -218,13 +218,36 @@ class CProtEadModuleModule(reactContext: ReactApplicationContext) :
218
218
  @ReactMethod
219
219
  fun getDeviceFingerprint(promise: Promise) {
220
220
  try {
221
- val result = module?.getDeviceFingerprint() ?: ""
222
- promise.resolve(result)
221
+ module?.let { it ->
222
+ it.getDeviceFingerprint { fingerprint ->
223
+ try {
224
+ val result = fingerprint ?: ""
225
+ promise.resolve(result)
226
+ } catch (e: Exception) {
227
+ promise.reject("CALLBACK_ERROR", "Error inside fingerprint callback", e)
228
+ }
229
+ }
230
+ } ?: run {
231
+ promise.reject("MODULE_NOT_INITIALIZED", "The module is null.")
232
+ }
223
233
  } catch (e: Exception) {
224
- promise.reject("GET_DEVICE_FINGERPRINT_ERROR", "Failed to get device fingerprint", e)
234
+ promise.reject("CALL_ERROR", "Failed to invoke getDeviceFingerprint", e)
225
235
  }
226
236
  }
227
237
 
238
+ @ReactMethod
239
+ fun setPendingNotification(className: String?, argumentKey: String?, argumentPayload: String?) {
240
+ try {
241
+ module?.let { localModule ->
242
+ if (className == null) {
243
+ return
244
+ }
245
+
246
+ localModule.setPendingCProtNotification(className, argumentKey, argumentPayload)
247
+ }
248
+ } catch (e: Exception) {}
249
+ }
250
+
228
251
  @ReactMethod
229
252
  fun isRunInEmulator(promise: Promise) {
230
253
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.cprot.ead",
3
- "version": "1.0.8135",
3
+ "version": "1.0.8151",
4
4
  "description": "c-prot ead android module",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "lib/commonjs/index.js",