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
Method 1: React Native SDK (Recommended)
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-webviewv13.x (peer dependency)react-native-safe-area-contextv4.0+ (peer dependency)- iOS 11+ / Android 5.0+
Installation
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
TheKomoCard component combines everything - metadata fetching, card cover display, and modal handling.
- Go to Komo Portal → Card Settings → Embed tab
- Click “React Native code” in sidebar
- Copy “Card embed meta URL”
Form prefilling
Pass user data to prefill forms in the embedded experience: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 formcard-finished- User completed a card / gameplay experiencecard-started- User began interacting with a cardcoupon-redeemed- User redeemed a coupon
UTM tracking & analytics
Track campaign attribution:Extension data
Pass custom data to analytics integrations (no PII):Shared authentication with KomoClientProvider
Wrap your app inKomoClientProvider 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.
appId- Workspace app ID copied from the Komo Portal, including region prefix (for exampleau1_<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, ... } }.
- Provider mode appends
komo_sessionto embedded experience URLs. - Legacy per-open
embedAuthUrlandauthPassthroughParamsflows are ignored underKomoClientProvider. A development-only warning is logged if you pass them. - Apps that do not use
KomoClientProviderkeep existing behavior, including Auth0 session transfer.
useKomoSession inside the provider to read the current session, force re-identification, or log out.
Auth0 session transfer (no provider)
If you are not usingKomoClientProvider, the SDK still supports per-open Auth0 session transfer:
- Auth0 SSO configured on Komo Hub
- “Force Embed Auth” enabled in Embed SDK settings
- Session transfer token obtained immediately before opening (60s lifespan)
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
BothKomoCard 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.
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
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):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 thekomoEmbed object:
React Native WebView with JS Bridge
Platform-Specific Considerations
iOS
App Transport Security (ATS): Ensure your hub domain is allowed:Android
Hardware Acceleration: Enable for smooth WebView performance:Performance Tips
Optimize Loading:- Use single card pages (not full hub) for faster load
- Enable caching in WebView settings
- Preload metadata when possible
- Dispose WebViews when not visible
- Limit concurrent embedded experiences
- Monitor memory usage on low-end devices
Authentication & SSO
Auth0 in React Native
- Detect user needs authentication
- Obtain fresh session transfer token from Auth0
- Pass to Komo widget
- Token valid for 60 seconds only
Custom Authentication
For non-Auth0 setups, use form prefilling:Testing & Debugging
Development Tips
Enable Debug Mode:Common Issues
White Screen:- Check URL is correct and accessible
- Verify network permissions
- Enable WebView debugging
- Use single card mode
- Enable WebView caching
- Optimize images in Komo
- Verify field Unique IDs match
- Check data types (strings only)
- Ensure form is loaded before prefilling
- 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:Related Documentation
- React Native Package - NPM documentation
- Developer Docs - Full API reference
Need Help? Contact [email protected] for mobile integration assistance.
