Anyline Infinity Plugins

The Anyline Infinity Plugin is the current scanning API for cross-platform integrations. It provides a schema-driven, persistent-session interface that replaces the legacy plugin API.

Key Features

  • Schema-driven configuration: scan behavior is defined entirely by JSON schemas (ScanViewConfig), making it easy to customize without code changes

  • Persistent session: a single session remains active across multiple scan operations, enabling scan switching and continuous workflows

  • Unified API: identical method names and parameters across all supported platforms, with only calling conventions differing

  • Event-based results: scan results stream in real-time (0..N results per session) rather than one-shot callbacks

The Legacy Plugin and the Infinity Plugin are delivered in the same package, but they must not be used together in the same application.

Both plugins communicate with the native Anyline SDK through a shared internal session. Using both simultaneously causes:

  • Session state conflicts: the Legacy Plugin’s one-shot lifecycle and the Infinity Plugin’s persistent session compete for the same underlying connection, causing events (scan results, errors) to be routed unpredictably.

  • Initialization interference: each plugin triggers SDK initialization independently. Concurrent or interleaved initialization can lead to license validation errors or silent failures.

If you are migrating from the Legacy Plugin, complete the migration fully before removing legacy code. Do not call methods from both plugins within the same application lifecycle.

Supported Platforms

Platform Package

React Native

anyline-ocr-react-native-module

Native Platform Requirements

Android

  • Android SDK Level >= 21

  • An Android device with decent camera functionality (recommended: 720p and adequate auto focus)

Camera Permission

Add the camera permission to your AndroidManifest.xml:

AndroidManifest.xml
<uses-permission android:name="android.permission.CAMERA" />

Enable desugaring

Make sure to enable desugaring in your app’s build.gradle, as follows:

app/build.gradle
android {
    compileOptions {
        coreLibraryDesugaringEnabled true
        sourceCompatibility = JavaVersion.VERSION_17
        targetCompatibility = JavaVersion.VERSION_17
    }
}

dependencies {
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3'
}

iOS

  • Minimum OS version: 12.0

For your iOS Xcode project, also make sure that the "Bitcode enabled" build setting is set to NO.

On your application’s Info.plist file, you are also required to include an entry for "Privacy - Camera Usage Description" with the value being the message you display to the user the first time the camera usage permission prompt is displayed.

Session Lifecycle

The Infinity Plugin follows a clear lifecycle:

  1. Initialize the SDK with your license key (requestSdkInitialization)

  2. Start scanning with a ScanViewConfig (requestScanStart)

  3. Receive results as they arrive (0..N results via event stream)

  4. Optionally switch scan modes without stopping (requestScanSwitchWith…​)

  5. Stop scanning when done (requestScanStop), or let the session end automatically when cancelOnResult is true (stops scanning after the first result)

  6. Clean up resources when the plugin is no longer needed (dispose)

Next Steps