From fe3706e9689074351adaf81a76d8f713a3ba3502 Mon Sep 17 00:00:00 2001 From: Felipe Cornejo Date: Fri, 21 Jun 2024 15:41:22 -0300 Subject: [PATCH] fix: fix android dependency import --- android/build.gradle | 5 ++++- android/src/main/java/com/iovation/IovationModule.kt | 2 +- ios/Iovation.mm | 6 ++++++ ios/Iovation.swift | 5 +++++ src/index.tsx | 2 +- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 8179cdb..6e6c0b4 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -85,6 +85,9 @@ android { repositories { mavenCentral() google() + flatDir { + dirs 'libs' + } } def kotlin_version = getExtOrDefault("kotlinVersion") @@ -95,6 +98,6 @@ dependencies { //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - compileOnly fileTree(include: ['*.jar','*.aar'], dir: 'libs') + api fileTree(dir: 'libs', include: ['*.aar']) } diff --git a/android/src/main/java/com/iovation/IovationModule.kt b/android/src/main/java/com/iovation/IovationModule.kt index e523588..6b8a506 100644 --- a/android/src/main/java/com/iovation/IovationModule.kt +++ b/android/src/main/java/com/iovation/IovationModule.kt @@ -32,7 +32,7 @@ class IovationModule(reactContext: ReactApplicationContext) : } @ReactMethod - fun getBlackbox(promise: Promise) { + fun getBlackbox(a: Double, b: Double, promise: Promise) { val blackbox = FraudForceManager.getBlackbox(context) promise.resolve(blackbox) } diff --git a/ios/Iovation.mm b/ios/Iovation.mm index fdfcde4..e53d73a 100644 --- a/ios/Iovation.mm +++ b/ios/Iovation.mm @@ -8,6 +8,12 @@ @interface RCT_EXTERN_MODULE (Iovation, NSObject) : (RCTPromiseResolveBlock)resolve withRejecter : (RCTPromiseRejectBlock)reject) +RCT_EXTERN_METHOD(getBlackbox + : (float)a withB + : (float)b withResolver + : (RCTPromiseResolveBlock)resolve withRejecter + : (RCTPromiseRejectBlock)reject) + + (BOOL)requiresMainQueueSetup { return NO; } diff --git a/ios/Iovation.swift b/ios/Iovation.swift index b487712..3318d3b 100644 --- a/ios/Iovation.swift +++ b/ios/Iovation.swift @@ -5,4 +5,9 @@ class Iovation: NSObject { func multiply(a: Float, b: Float, resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) -> Void { resolve(a*b) } + + @objc(getBlackbox:withB:withResolver:withRejecter:) + func multiply(a: Float, b: Float, resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) -> Void { + resolve("not supported") + } } diff --git a/src/index.tsx b/src/index.tsx index 7432e9d..454d34d 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -22,5 +22,5 @@ export function multiply(a: number, b: number): Promise { } export function getBlackbox(): Promise { - return Iovation.getBlackbox(); + return Iovation.getBlackbox(1, 1); }