For the complete documentation index, see llms.txt. This page is also available as Markdown.

Native Modules Setup

The Self Mobile SDK requires minimal native module configuration for Android and iOS to enable camera access and NFC scanning.

Android Setup

1. MainActivity Configuration

Add the import and NFC intent handling to your android/app/src/main/java/com/yourapp/MainActivity.kt:

import com.selfxyz.selfSDK.RNSelfPassportReaderModule
import android.content.Intent
import android.util.Log

class MainActivity : ReactActivity() {
    
    override fun onNewIntent(intent: Intent) {
        super.onNewIntent(intent)
        Log.d("MAIN_ACTIVITY", "onNewIntent: " + intent.action)
        try {
            RNSelfPassportReaderModule.getInstance().receiveIntent(intent)
        } catch (e: IllegalStateException) {
            Log.w("MAIN_ACTIVITY", "RNSelfPassportReaderModule not ready; deferring NFC intent")
            setIntent(intent)
        }
    }
}

2. MainApplication Configuration

Add the SelfSDK package to your android/app/src/main/java/com/yourapp/MainApplication.kt:

3. Android Manifest Permissions

Add these permissions to android/app/src/main/AndroidManifest.xml:

4. NFC Meta Data

Add this meta-data to your MainActivity in AndroidManifest.xml:

Create the NFC tech filter file at android/app/src/main/res/xml/nfc_tech_filter.xml:

5. Build Configuration

Add this to your android/app/build.gradle:

iOS Setup

1. Enable NFC Capability

In Xcode, enable the NFC capability for your app:

  1. Open your project in Xcode

  2. Select your app target

  3. Go to "Signing & Capabilities"

  4. Click "+ Capability" and add "Near Field Communication Tag Reading"

Important: Set your build scheme to Release as Debug mode is not currently supported.

2. Info.plist Permissions

Add these usage descriptions to your ios/YourApp/Info.plist:

3. Podfile Configuration

Add the following to your ios/Podfile in the post_install block:

Installation

Last updated