Example: React Native Integration with Device SDK

Place the Device SDK file

  1. Download the SDK from the Developer Console

  2. Place it in android/app/libs/magic-auth-tool.aar

Configure proguard-rules.pro

-keep class com.magic.auth.**{*;}

Configure build.gradle

// android/app/build.gradle

dependencies {
   implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')  
}

Configure AndroidManifest.xml

// android/app/src/main/AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.xxx.xxx">
    <!-- Add address-related read permissions-->
    <uses-permission android:name="com.bitboy.info.READ"/>
</manifest>

Create MyAppPackage.kt

Create DeviceCommunicationModule.kt

Remember to configure the APP_KEY obtained from the Developer Console

Edit MainApplication.kt

Call Function

Last updated