React Native Quick Start
Get MovableInk deeplinking working in your React Native app in under 10 minutes.
Prerequisites
Before you begin, ensure you have:
- [x] Your MovableInk subdomain (e.g.,
mi.yourcompany.com) - [x] AASA and Digital Asset Links files configured by MovableInk
- [x] React Native >=0.60
- [x] iOS deployment target of iOS 13.0+
- [x] Android minSdkVersion of 24+
Need Help?
If you don't have these prerequisites, see the Getting Started guide or contact your Movable Ink client experience team.
Step 1: Install the SDK
Then install iOS dependencies:
Step 2: Configure Native Platforms
Since React Native builds native iOS and Android apps, you need to configure each platform:
iOS Configuration
Follow these steps from the iOS Quick Start:
- Open
ios/YourApp.xcworkspacein Xcode - Add Associated Domains capability
- Add your MovableInk domain:
applinks:mi.yourcompany.com - Add
movable_ink_universal_link_domainsto Info.plist
Android Configuration
Follow these steps from the Android Quick Start:
- Add intent filters to
android/app/src/main/AndroidManifest.xml - Set
android:autoVerify="true" - Configure all required path prefixes (
/p/cpm,/p/rpm,/p/gom)
Step 3: Handle Incoming Links
In your App.tsx or App.js:
import React, { useEffect } from 'react';
import { Linking } from 'react-native';
import RNMovableInk from 'react-native-movable-ink';
function App() {
useEffect(() => {
// Handle deeplinks
const handleDeeplink = (event: { url: string }) => {
if (event.url) {
resolveMovableInkLink(event.url);
}
};
// Listen for deeplinks while app is running
const subscription = Linking.addEventListener('url', handleDeeplink);
// Handle deeplink that opened the app
Linking.getInitialURL().then(url => {
if (url) {
resolveMovableInkLink(url);
}
});
return () => {
subscription.remove();
};
}, []);
const resolveMovableInkLink = (url: string) => {
RNMovableInk.resolveURL(url)
.then((resolvedURL: string) => {
console.log('Deeplink resolved to:', resolvedURL);
// TODO: Navigate to appropriate screen
navigateToContent(resolvedURL);
})
.catch((error: Error) => {
console.error('Failed to resolve link:', error);
});
};
const navigateToContent = (url: string) => {
// Parse URL and navigate
if (url.includes('/products/')) {
// Navigate to product detail
// navigation.navigate('ProductDetail', { productId });
} else if (url.includes('/categories/')) {
// Navigate to category
}
};
return (
// Your app content
<YourAppContent />
);
}
export default App;
Step 4: Verify It Works
- Build and run your app on iOS or Android
- Test with a MovableInk link (ask your team for a test link)
- Check the console for:
Deeplink resolved to: https://...
It Works!
If you see the resolved URL in the console, your integration is working!