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:

Terminal
npm install @mobana/react-native-sdk \
  @react-native-async-storage/async-storage

With Flows:

Terminal
npm install @mobana/react-native-sdk \
  @react-native-async-storage/async-storage \
  react-native-webview

Optional Flow Enhancements:

Terminal
# 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
PackagePurpose
react-native-haptic-feedbackHaptic feedback in flows
react-native-permissionsPermission prompts in flows (notifications, location, ATT)
react-native-in-app-reviewApp store review prompts
react-native-geolocation-serviceLocation services in flows
react-native-safe-area-contextSafe 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.

ios/Podfile
# 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:

Terminal
cd ios && pod install

Android Setup#

Add permissions to your AndroidManifest.xml. Only include permissions for features your flows actually use.

android/app/src/main/AndroidManifest.xml
<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:

Terminal
npx expo install @mobana/react-native-sdk \
  @react-native-async-storage/async-storage

With Flows:

Terminal
npx expo install @mobana/react-native-sdk \
  @react-native-async-storage/async-storage \
  react-native-webview

Optional Flow Enhancements:

Terminal
npx expo install react-native-haptic-feedback \
  react-native-permissions \
  react-native-in-app-review \
  react-native-geolocation-service \
  react-native-safe-area-context

Configure Expo#

Add the plugin to your app.json or app.config.js:

Attribution-only (no special permissions):

app.json
{
  "expo": {
    "plugins": ["@mobana/react-native-sdk"]
  }
}

With Flows (add permissions you need):

app.json
{
  "expo": {
    "plugins": [
      ["@mobana/react-native-sdk", {
        "permissions": [
          "Notifications",
          "AppTrackingTransparency",
          "LocationWhenInUse",
          "LocationAlways"
        ]
      }]
    ]
  }
}
PermissioniOSAndroidUse Case
NotificationsWhen using react-native-permissions (optional)Adds POST_NOTIFICATIONSPush notification prompts
AppTrackingTransparencyConfigures ATT + Info.plistN/A (iOS only)ATT prompts (iOS 14.5+)
LocationWhenInUseConfigures location + Info.plistAdds ACCESS_FINE/COARSE_LOCATIONForeground location
LocationAlwaysConfigures background locationAdds ACCESS_BACKGROUND_LOCATIONBackground location

Build#

After configuring, run prebuild to generate native code:

Terminal
npx expo prebuild

Verify Installation#

Quick check that the SDK initializes correctly:

App.tsx
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 console

For complete testing of attribution, conversions, and flows, see the Test Setup Guide.