Skip to main content
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.
By the end of this guide, tapping a button in your app opens LearnInk with the user already signed in.
This package does not require react-native-webview. It wraps the native LearnInk Android SDK directly, so behaviour matches the other frameworks exactly.

Prerequisites

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.
Every developer on your team must run this once, and so must your CI runner. This step disappears when we publish to Maven Central.
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:
Never call the LearnInk Identify API directly from your app. That would put your API key on user devices, where it can be extracted. Your app calls your backend; your backend holds the key.
6

Render the component

Do not render LearnInkWebView inside a React Native Modal. On the new architecture, touches do not reach native views hosted in a Modal, so LearnInk appears but does not respond to taps. Use a dedicated screen in your navigator, or a conditionally rendered full-screen View as above.
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
If you see a login screen, the token did not reach LearnInk — see Troubleshooting.

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.