Installation
Detailed installation instructions for bare React Native and Expo projects.
Requirements#
- • React Native 0.68 or later
- • iOS 13.0+ / Android 5.0+ (API 21+)
- • For Expo: SDK 48+ with development builds (Expo Go not supported)
Bare React Native#
Install Packages#
Install the SDK and required peer dependencies:
Attribution + Conversions:
npm install @mobana/react-native-sdk \
@react-native-async-storage/async-storageWith Flows:
npm install @mobana/react-native-sdk \
@react-native-async-storage/async-storage \
react-native-webviewOptional Flow Enhancements:
# Optional packages for additional Flow capabilities
npm install react-native-haptic-feedback \
react-native-permissions \
react-native-in-app-review \
react-native-geolocation-service \
react-native-safe-area-context| Package | Purpose |
|---|---|
react-native-haptic-feedback | Haptic feedback in flows |
react-native-permissions | Permission prompts in flows (notifications, location, ATT) |
react-native-in-app-review | App store review prompts |
react-native-geolocation-service | Location services in flows |
react-native-safe-area-context | Safe area insets (recommended) |
iOS Setup (optional, for flows with permissions)#
Only needed if you use react-native-permissions (flows that request notifications, location, or ATT). Configure permissions in your Podfile. Only include permissions for features your flows actually use. Attribution-only and flows without permission prompts don't need this.
# In ios/Podfile, add before target block:
def node_require(script)
require Pod::Executable.execute_command('node', ['-p',
"require.resolve('#{script}', {paths: [process.argv[1]]})",
__dir__]).strip
end
node_require('react-native-permissions/scripts/setup.rb')
# Only include permissions you actually need:
setup_permissions([
'Notifications', # For notification permission prompts
'AppTrackingTransparency', # For ATT prompts (iOS 14.5+)
'LocationWhenInUse', # For foreground location flows
'LocationAlways', # For background location flows
])Then install pods:
cd ios && pod installAndroid Setup#
Add permissions to your AndroidManifest.xml. Only include permissions for features your flows actually use.
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- For notification permission prompts (Android 13+) -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<!-- For foreground location flows -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<!-- For background location flows -->
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<!-- ... rest of your manifest -->
</manifest>Expo (Development Build)#
This SDK requires native code. Expo Go is not supported. Use expo-dev-client for development builds.
Install Packages#
Attribution + Conversions:
npx expo install @mobana/react-native-sdk \
@react-native-async-storage/async-storageWith Flows:
npx expo install @mobana/react-native-sdk \
@react-native-async-storage/async-storage \
react-native-webviewOptional Flow Enhancements:
npx expo install react-native-haptic-feedback \
react-native-permissions \
react-native-in-app-review \
react-native-geolocation-service \
react-native-safe-area-contextConfigure Expo#
Add the plugin to your app.json or app.config.js:
Attribution-only (no special permissions):
{
"expo": {
"plugins": ["@mobana/react-native-sdk"]
}
}With Flows (add permissions you need):
{
"expo": {
"plugins": [
["@mobana/react-native-sdk", {
"permissions": [
"Notifications",
"AppTrackingTransparency",
"LocationWhenInUse",
"LocationAlways"
]
}]
]
}
}| Permission | iOS | Android | Use Case |
|---|---|---|---|
Notifications | When using react-native-permissions (optional) | Adds POST_NOTIFICATIONS | Push notification prompts |
AppTrackingTransparency | Configures ATT + Info.plist | N/A (iOS only) | ATT prompts (iOS 14.5+) |
LocationWhenInUse | Configures location + Info.plist | Adds ACCESS_FINE/COARSE_LOCATION | Foreground location |
LocationAlways | Configures background location | Adds ACCESS_BACKGROUND_LOCATION | Background location |
Verify Installation#
Quick check that the SDK initializes correctly:
import { Mobana } from '@mobana/react-native-sdk';
await Mobana.init({
appId: 'YOUR_APP_ID',
debug: true, // Enable logging
});
// You should see "Mobana initialized" in your consoleFor complete testing of attribution, conversions, and flows, see the Test Setup Guide.