Quick Start

Get Mobana integrated in your React Native app in 5 minutes.

1. Install the SDK#

Install the SDK and its peer dependencies. The packages you need depend on which features you'll use.

Attribution + Conversions only:

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

With Flows (add react-native-webview):

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

Optional flow enhancements:

Terminal
npm install react-native-haptic-feedback \
  react-native-permissions \
  react-native-in-app-review \
  react-native-geolocation-service \
  react-native-safe-area-context
Expo users

Use npx expo install instead of npm install. This SDK requires native code, so Expo Go is not supported. Use expo-dev-client for development builds. See Expo installation for full setup and optional flow enhancements.

2. Initialize the SDK#

Initialize Mobana once when your app starts. This must be called before any other SDK methods.

App.tsx
import { Mobana } from '@mobana/react-native-sdk';

// Initialize once on app start (e.g., in App.tsx or your entry point)
await Mobana.init({
  appId: 'YOUR_APP_ID',  // From your Mobana dashboard
  debug: __DEV__,        // Optional: enable logging in development
});

Get your App ID from the Mobana Dashboard. Create a new app if you haven't already.

3. Get Attribution#

Retrieve attribution data to know where your install came from. The SDK handles caching, retries, and Android Install Referrer automatically.

App.tsx
const attribution = await Mobana.getAttribution();

if (attribution) {
  // Send to your analytics provider
  analytics.identify({
    utm_source: attribution.utm_source,
    utm_campaign: attribution.utm_campaign,
    utm_medium: attribution.utm_medium,
  });

  // Handle deeplink data
  if (attribution.data?.promo) {
    applyPromoCode(attribution.data.promo);
  }
}

Attribution data includes UTM parameters (utm_source, utm_campaign, etc.) and any custom data you passed in your redirect URLs.

4. Track Conversions#

Track post-install events to measure campaign ROI. Conversions are automatically linked to the original attribution.

your-app.tsx
// Track conversions wherever events happen in your app
Mobana.trackConversion('signup');
Mobana.trackConversion('purchase', 49.99);
Mobana.trackConversion('subscription', 9.99);

Make sure to configure your conversion types in the Dashboard first. Conversions are queued offline and sent when connection is available.

5. Launch Flows#

Display beautiful in-app experiences like onboarding, permission prompts, or feature announcements. Flows require react-native-webview and the provider wrapper.

Wrap your app with the provider:

App.tsx
import { MobanaProvider } from '@mobana/react-native-sdk';

export default function App() {
  return (
    <MobanaProvider>
      {/* Your app */}
    </MobanaProvider>
  );
}

Start a flow:

screens/Welcome.tsx
const result = await Mobana.startFlow('onboarding');

if (result.completed) {
  console.log('User completed onboarding!', result.data);
  navigation.navigate('Home');
} else if (result.dismissed) {
  console.log('User dismissed the flow');
}

6. Create Your First Campaign#

Create a redirect URL to use in your ad campaigns:

Campaign URL
https://YOUR_APP_ID.mobana.ai/redirect
  ?utm_source=facebook
  &utm_campaign=summer_launch
  &utm_medium=cpc
  &data={"promo":"WELCOME10"}

When users click this link, Mobana captures the attribution data and redirects them to the appropriate app store. After install, the SDK retrieves this data.

Next Steps#