Beta — installed from GitHub. During the beta you install the package from a local
tarball and build its Android half once. When we publish to npm and Maven Central,
both steps collapse into a single
npm install @learnink/react-native-sdk. See
Overview.This package does not require
react-native-webview. It wraps the native LearnInk
Android SDK directly, so behaviour matches the other frameworks exactly.Prerequisites
- React Native 0.71 or newer (both old and new architecture are supported)
- JDK 17 or newer for the Android build
- Your app’s
minSdkVersionis 21 or higher - A backend endpoint that returns a LearnInk sign-in token — see Step 1 of the WebView setup guide
- Your org ID
- Access to github.com/LearnInkTeam/learnink-sdk
The SDK targets Android. Render
LearnInkWebView only in your Android flow.1
Build the SDK's Android half
The package wraps a native Android library, which you build once on your machine:You should see
BUILD SUCCESSFUL.Build fails with 'Gradle requires JVM 17 or later'
Build fails with 'Gradle requires JVM 17 or later'
Your default JDK is too old:
2
Pack the JavaScript package
From the same clone, produce an installable tarball:This creates
learnink-react-native-sdk-0.1.0.tgz in that folder.We recommend the tarball over
npm install <path>. A path install creates a symlink,
which Metro does not resolve without extra configuration; the tarball installs a normal
copy and just works. It also gives you a single file you can commit or share with your
team so nobody else needs to run this step.3
Install it into your app
From your app’s root:Autolinking picks up the native module — no manual linking required. If your app
registers packages explicitly, add
LearnInkSdkPackage() to your MainApplication.4
Let your app find the native library
Your Android build needs to resolve the library you published in Step 1. In your app’s
android/build.gradle:android/build.gradle
React Native templates already declare
google() and mavenCentral() elsewhere, so you
only need to add mavenLocal().5
Write your token function
Create a function that calls your backend and returns the token string:
6
Render the component
Always give the component
flex: 1 or explicit dimensions. With no height it renders
nothing.7
Verify it works
Run on an Android device or emulator. You should see:
- ✅ A brief loading indicator, then LearnInk content
- ✅ No login screen — the user is signed in automatically
- ✅ Tapping close inside LearnInk hides the component
Controlling the view
Attach a ref to drive the component after mount:Props reference
Next steps
Offline behaviour
What your app must show when a user has no connection and nothing downloaded.
Push notifications
Still required — the SDK does not change how notifications reach users.