Skip to content

Commit

Permalink
fix: fix android dependency import
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecornejo1 committed Jun 21, 2024
1 parent 005c065 commit fe3706e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
5 changes: 4 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ android {
repositories {
mavenCentral()
google()
flatDir {
dirs 'libs'
}
}

def kotlin_version = getExtOrDefault("kotlinVersion")
Expand All @@ -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'])
}

2 changes: 1 addition & 1 deletion android/src/main/java/com/iovation/IovationModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
6 changes: 6 additions & 0 deletions ios/Iovation.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 5 additions & 0 deletions ios/Iovation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ export function multiply(a: number, b: number): Promise<number> {
}

export function getBlackbox(): Promise<string> {
return Iovation.getBlackbox();
return Iovation.getBlackbox(1, 1);
}

0 comments on commit fe3706e

Please sign in to comment.