Skip to main content

Get started React Native

1. Prerequisites

React Native is a widely used framework for developing mobile applications with JavaScript or TypeScript. You can create a new React Native project using either expo or react-native-cli. To set up the necessary dependencies, consult the official documentation for both tools.

Dependency compatibility

React Native architecture

We don't currently support React Native's new architecture. You must ensure you are using React Native 0.75.4 or earlier, and have the new architecture disabled.

VersionRelease dateReact NativeReactExpo
4.0July 2025~0.79~19~53
3.0June 20250.75.418.3.151
2.0January 20250.75.418.3.151
1.7June 20240.75.418.3.151

Device compatibility

VersionMin iOSMin Android
4.015.1+21+
3.015.1+24+
2.013+24+
1.713+21+
npm install -g expo-cli

Expo configuration plugin allows developers to customize native build settings for their Expo-managed projects. You may need to install expo-build-properties by

expo install expo-build-properties

2. Installation

npm install @weavr-io/secure-components-react-native

Before integrating into your app, ensure the necessary sources are added to iOS and Android.

Podfile
source 'https://cdn.cocoapods.org/'
source 'https://github.com/SumSubstance/Specs.git'

# Either explicitly state dynamic linking on your Cocoapods file, or use the properties file of
# your React Native / Expo project to ensure dynamic linkage is used by your app.
use_frameworks! : linkage => :dynamic # Required by Approov

Using Expo

Additional configuration is required when using Expo.

Firstly, export the asset path as demonstrated in the following example:

react-native.config.js
const path = require("path");

module.exports = {
assets: ["./assets/fonts/"],
};

Additionally, set up the necessary permissions in the plugin configuration.

app.config.ts
plugins: [
[
'@weavr-io/secure-components-react-native',
{
permissions: {
"photosPermission": "Allow $(PRODUCT_NAME) to access photos in your library to perform KYC",
"cameraPermission": "Allow $(PRODUCT_NAME) to open the camera to perform KYC",
"microphonePermission": "Allow $(PRODUCT_NAME) to use the microphone to perform KYC",
"locationWhenInUseUsage": "Allow $(PRODUCT_NAME) to get access to your location while in use to perform KYC",
"faceIdUsage": "Allow $(PRODUCT_NAME) to get access to Face ID to login with biometrics"
}
} as WithWeavrSDKConfig
],
[
'expo-build-properties',
{
android: {
compileSdkVersion: 35,
targetSdkVersion: 35,
buildToolsVersion: '35.0.0',
},
ios: {
deploymentTarget: '15.1',
},
},
],
],

As Biometric Authentication works with the Firebase push notification service, you might need to add Firebase react-native dependencies to your app. So, on your package.json add:

package.json
   "@react-native-firebase/app": "14.12.0",
"@react-native-firebase/messaging": "14.12.0",
"@react-native-push-notification": "^8.1.1",
"@react-native-community/push-notification-ios": "^1.11.0", //for ios Only
"@react-native-firebase/app": "^21.4.1",
"@react-native-firebase/app-check": "^21.13.0",

Follow the instruction and installation guide at React Native Firebase to download and configure google.services.json (for Android) and GoogleService-Info.plist(for iOS) on your app.

For expo managed apps only, add to your package.Json file

package.json
"@react-native-firebase/app",

To use expo-dev-client you must create and install a development build on your target device.

npx eas build --profile development --local

Finally

expo start

3. Set AppCheck token

To securely link Firebase App Check protection with Weavr’s SDK components, you must retrieve and store the App Check token before sensitive operations like login or biometric enrolment.

tip

You can use React Native Firebase to fetch your token

The setAppCheckToken() method securely injects the App Check token into the SDK.

setAppCheckToken("");

The method setAppCheckToken() returns a boolean.

true: the token was stored successfully in the SDK.

false: the firebase App Check token was not accepted —- ensure the token is valid and properly formatted.

4. Initialize the SDK

After the libraries are in place, you can initialize the Weavr component SDK by:

import {
initializeUXComponents,
initializePSA,
} from "@weavr-io/secure-components-react-native";

initializeUXComponents(env, WEAVR_UI_KEY)
.then((res) => console.log(res))
.catch((e) => console.log(e));

//if you are using weavr biometric, you need to initialise the biometric solution too:
initializePSA(env)
.then((res) => console.log(res))
.catch((e) => console.log(e));