diff --git a/README.md b/README.md index 50c9206..3d12a53 100644 --- a/README.md +++ b/README.md @@ -23,4 +23,19 @@ repositories { maven { url('https://transmit.jfrog.io/artifactory/transmit-security-gradle-release-local/') } -} \ No newline at end of file +} + + +Initialize using strings.xml configuration: +To do this, update the strings.xml file in your Application with the following content. The CLIENT_ID should be replaced with your client ID + + + + "default_application" + "CLIENT_ID" + https://api.transmitsecurity.io/ + + +Call the dedicated Android function to initialize the SDK. Open your MainApplication.kt file and add the following to the bottom of the function onCreate() +TsIdentityOrchestrationModule.initializeAndroidSDK(this) + \ No newline at end of file diff --git a/android/src/main/java/com/tsidentityorchestration/TsIdentityOrchestrationModule.kt b/android/src/main/java/com/tsidentityorchestration/TsIdentityOrchestrationModule.kt index c089461..3aede4b 100644 --- a/android/src/main/java/com/tsidentityorchestration/TsIdentityOrchestrationModule.kt +++ b/android/src/main/java/com/tsidentityorchestration/TsIdentityOrchestrationModule.kt @@ -1,5 +1,6 @@ package com.tsidentityorchestration +import android.content.Context import com.facebook.react.bridge.Arguments import com.facebook.react.bridge.Promise import com.facebook.react.bridge.ReactApplicationContext @@ -30,8 +31,10 @@ class TsIdentityOrchestrationModule(private val reactContext: ReactApplicationCo @ReactMethod fun initializeSDK(promise: Promise) { - TSIdo.initializeSDK(reactContext) - promise.resolve(true) + promise.reject( + "TSIDOModule", + "On Android, please call the initializeAndroidSDK function from your Application class" + ) } @ReactMethod @@ -213,5 +216,9 @@ class TsIdentityOrchestrationModule(private val reactContext: ReactApplicationCo companion object { const val NAME = "TsIdentityOrchestration" + + fun initializeAndroidSDK(context: Context) { + TSIdo.initializeSDK(context) + } } } diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 4122f36..8bbf09b 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -1,8 +1,9 @@ - + TsIdentityOrchestrationExample + "default_application" + "CLIENT_ID" + https://api.transmitsecurity.io/