This Sample App demonstrates how to integrate Superpowered SDK with React Native.
Ensure that you have node
and npm
or yarn
installed.
See React Native's Getting Started Guide.
To try out this example project:
- Run
npm install
oryarn install
.
- Android:
npm run android
oryarn run android
- iOS: Before the first install please make sure to run
pod install
from theios
folder. After you can call:npm run ios
ornpm run ios
.
In order to use the Superpowered SDK in a React Native application you need to set up a Turbo native module that you can import in your JavaScript code. You need to create a separate native module for all platforms that you support. See React Native's Turbo Native Modules documentation.
Integrate the Superpowered SDK into the React Native generated iOS project by following the iOS Integration Guide.
You can put together your module in an Objective-C file and only expose the methods that you will need to call from JavaScript. For further info check out this guide.
Integrate the Superpowered SDK into the React Native generated Android project by following the Android Integration Guide.
You can put together your module in a Java/Kotlin file and only expose the methods that you will need to call from JavaScript. For further info check out this guide.
After the Turbo native module is set up you can import it and call it in your JavaScript code.