Deep Linking
Using Intercom you can embed a deep link in your in-app messages or as the URI for your push messages.
There are comprehensive guides on enabling deep links on both platforms here.
Setting up a Deep Link in Android
You'll need to set up a deep link in your apps AndroidManifest.xml
. Android supports both app://page and http://www.app.com/page type schemes.
<activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> <!-- START: Add this --> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.BROWSABLE"/> <data android:scheme="http" android:host="Your app url(www.app.com)"/> <!-- Edit this line --> <data android:scheme="Your app scheme(app)"/> <!-- Edit this line --> </intent-filter> <!-- END: Add this --> </activity>
To ensure your app navigates to the correct screen when a deep link is used, add the following code to your MainActivity
override fun onNewIntent(intent: Intent) { super.onNewIntent(intent) setIntent(intent) }
Setting up a Deep Link in iOS
Intercom supports both Universal Links and Custom URL Schemes as a deep link.
Please follow the instructions for Universal Links on our main iOS page.
You'll also need to add the import to your AppDelegate.m
#import "AppDelegate.h" #import <React/RCTBridge.h> #import <React/RCTBundleURLProvider.h> #import <React/RCTRootView.h> #import <React/RCTLinkingManager.h> // <--Add this
Add finally include this snippet code in your AppDelegate.m
above @end
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options { return [RCTLinkingManager application:application openURL:url options:options]; }
Linking to your app
Once you have set up your app to respond to your deep link, you can send a push message with that as the URI. Tapping the push message will open your app to the specified page.
You can also add a link to your in-app messages and replies as follows: