Skip to main content

Mobile App Integration

Complete guide to embedding Komo experiences in mobile applications.
Important Note: Komo does not provide native iOS or Android SDKs. All mobile integration is done via WebViews - this is the recommended and only supported approach for embedding Komo in mobile apps.
Three WebView-based approaches available:
  • React Native SDK (recommended for React Native apps) - Uses WebView under the hood
  • Direct WebView (simplest for any platform) - Native iOS/Android WebView
  • Browser Embed SDK (for advanced hybrid apps) - WebView with JavaScript bridge

Overview

Native iOS & Android Apps

For native iOS (Swift/Objective-C) and native Android (Kotlin/Java) apps, use the Direct WebView method. Komo experiences run in a WebView component - there is no native SDK to import. Why WebViews?
  • Komo experiences are web-based and optimized for mobile browsers
  • WebViews provide full feature support without platform-specific SDKs
  • Consistent experience across all platforms
  • No app store approval delays for content updates

Three Integration Methods

Platform Guide:
  • React Native → Use React Native SDK (Method 1)
  • Native iOS (Swift) → Use Direct WebView (Method 2)
  • Native Android (Kotlin) → Use Direct WebView (Method 2)
  • Flutter → Use Direct WebView (Method 2)
  • Other frameworks → Use Direct WebView (Method 2) or Browser Embed SDK (Method 3)

Feature Comparison

What is it?

The official @komo-tech/react-native package provides pre-built React Native components for embedding Komo cards with full feature support including form prefilling, event listening, authentication, and analytics tracking. Requirements:
  • React Native app
  • react-native-webview v13.x (peer dependency)
  • react-native-safe-area-context v4.0+ (peer dependency)
  • iOS 11+ / Android 5.0+

Installation

Or with pnpm:
Wrap your app in SafeAreaProvider from react-native-safe-area-context (typically at your root component) so the SDK can read safe-area insets correctly. iOS Setup:

Quick Start: KomoCard

The KomoCard component combines everything - metadata fetching, card cover display, and modal handling.
Getting the embedMetaUrl:
  1. Go to Komo Portal → Card Settings → Embed tab
  2. Click “React Native code” in sidebar
  3. Copy “Card embed meta URL”

Form prefilling

Pass user data to prefill forms in the embedded experience:
Important: Object keys must match the Unique ID of form fields or contact properties in Komo.

Event listening

Listen for user interactions and events:
onKomoEvent is a convenience callback for Komo user interaction events. onWindowMessage exposes all raw window.postMessage events from the embedded experience. Common events (kebab-case names from the embed event payload):
  • form-submission - User submitted a form
  • card-finished - User completed a card / gameplay experience
  • card-started - User began interacting with a card
  • coupon-redeemed - User redeemed a coupon
There is no prize-won embed event. For the full list, see Events published to Tag Manager data layers.

UTM tracking & analytics

Track campaign attribution:
Dynamic campaign tracking:

Extension data

Pass custom data to analytics integrations (no PII):

Shared authentication with KomoClientProvider

Wrap your app in KomoClientProvider when you want every KomoCard and KomoExperienceModal underneath it to share a single authenticated Komo session. Provider mode is the recommended approach for apps that already authenticate users (e.g., via your own JWT-issuing backend) and want a consistent identity inside Komo experiences.
Required props:
  • appId - Workspace app ID copied from the Komo Portal, including region prefix (for example au1_<app-guid>).
  • getIdentityToken - Returns the identity payload used for session exchange. Supported identity types include { type: 'jwt', token }, { type: 'anonymous' }, and { type: 'email', attributes: { email, ... } }.
Behavior notes:
  • Provider mode appends komo_session to embedded experience URLs.
  • Legacy per-open embedAuthUrl and authPassthroughParams flows are ignored under KomoClientProvider. A development-only warning is logged if you pass them.
  • Apps that do not use KomoClientProvider keep existing behavior, including Auth0 session transfer.
Reading the provider session: Use useKomoSession inside the provider to read the current session, force re-identification, or log out.

Auth0 session transfer (no provider)

If you are not using KomoClientProvider, the SDK still supports per-open Auth0 session transfer:
Prerequisites:
  • Auth0 SSO configured on Komo Hub
  • “Force Embed Auth” enabled in Embed SDK settings
  • Session transfer token obtained immediately before opening (60s lifespan)
We recommend webViewProps={{ incognito: true }} so user session state is cleared correctly when switching between authenticated users.

Advanced: Custom implementation

Use individual components for full control:

Styling & customization

Customize the appearance:

Error handling

Handle loading and error states:

Debug mode

Both KomoCard and KomoExperienceModal accept a debugMode prop that logs the component lifecycle, URL construction, WebView events, and the iOS/Android/web message handshake to the console. Use it while diagnosing form prefill issues, stuck loading states, or platform-specific problems.
Only enable debugMode during development. Debug logs may include sensitive data and can impact performance — always disable in production builds.

Method 2: Direct WebView (Simplest)

What is it?

The simplest approach - embed Komo using a standard WebView component with the site or card URL. This is the recommended approach for native iOS and Android apps (Swift, Kotlin, Java) as well as Flutter and other frameworks.
Note: There is no native iOS SDK or native Android SDK for Komo. WebView is the standard and only approach for embedding in native mobile apps.
Best for:
  • Native iOS apps (Swift/Objective-C) ← Primary use case
  • Native Android apps (Kotlin/Java) ← Primary use case
  • Flutter apps
  • Quick prototyping
  • Simple embedding needs
  • When you don’t need advanced features

React Native WebView

With UTM Parameters:

iOS (Swift) - Native App Integration

This is the standard way to embed Komo in native iOS apps. There is no separate iOS SDK - WebView is the official integration method.

Android (Kotlin) - Native App Integration

This is the standard way to embed Komo in native Android apps. There is no separate Android SDK - WebView is the official integration method.

Flutter

URL Structure

Single Card (Recommended):
Full Hub:
With Query Parameters:

Limitations of Direct WebView

❌ Form prefilling - Limited to URL parameters only
❌ Event listening - No native callback support
❌ Auth0 session transfer - Must implement manually
❌ Extension data - Not supported
✅ UTM tracking - Works via URL parameters
✅ Basic display - Full Komo experience renders

Method 3: Browser Embed SDK (Advanced)

What is it?

For advanced use cases, use the Browser Embed SDK within a WebView. Provides JavaScript API for form prefilling, event listening, and authentication - even in mobile WebViews. Best for:
  • Hybrid apps with WebView
  • Advanced WebView implementations
  • When you need JS bridge communication

Setup

Include the embed script in HTML loaded by WebView:

JavaScript API in WebView

Once loaded, use the komoEmbed object:

React Native WebView with JS Bridge


Platform-Specific Considerations

iOS

App Transport Security (ATS): Ensure your hub domain is allowed:
Safe Area Insets: Handle notches and home indicators:

Android

Hardware Acceleration: Enable for smooth WebView performance:
Back Button Handling:

Performance Tips

Optimize Loading:
  • Use single card pages (not full hub) for faster load
  • Enable caching in WebView settings
  • Preload metadata when possible
Memory Management:
  • Dispose WebViews when not visible
  • Limit concurrent embedded experiences
  • Monitor memory usage on low-end devices

Authentication & SSO

Auth0 in React Native

Token Lifecycle:
  1. Detect user needs authentication
  2. Obtain fresh session transfer token from Auth0
  3. Pass to Komo widget
  4. Token valid for 60 seconds only

Custom Authentication

For non-Auth0 setups, use form prefilling:

Testing & Debugging

Development Tips

Enable Debug Mode:
Console Logging:

Common Issues

White Screen:
  • Check URL is correct and accessible
  • Verify network permissions
  • Enable WebView debugging
Slow Loading:
  • Use single card mode
  • Enable WebView caching
  • Optimize images in Komo
Form Prefill Not Working:
  • Verify field Unique IDs match
  • Check data types (strings only)
  • Ensure form is loaded before prefilling
Authentication Fails:
  • Session token must be fresh (< 60s)
  • Enable incognito mode for clean sessions
  • Check Auth0 configuration in Komo

Best Practices

Do:

  • ✅ Use React Native SDK for React Native apps
  • ✅ Implement error handling and retry logic
  • ✅ Test on real devices, not just simulators
  • ✅ Handle authentication token lifecycle properly
  • ✅ Use UTM parameters for attribution
  • ✅ Optimize images in Komo for mobile
  • ✅ Test network connectivity scenarios

Don’t:

  • ❌ Hardcode authentication tokens
  • ❌ Ignore loading and error states
  • ❌ Use full hub URLs when single card will do
  • ❌ Forget to handle back button (Android)
  • ❌ Disable all WebView security features
  • ❌ Assume desktop features work on mobile

Examples by Use Case

E-commerce App

Product Page Contest:

Event App

Live Trivia During Event:

Loyalty App

Points Redemption:


Need Help? Contact [email protected] for mobile integration assistance.