Troubleshooting
Troubleshooting React Native
Having trouble with the React Native SDK? This guide covers common issues and solutions. Go through each topic and see if it matches your issue. If you went through this guide and you're still having problems, reach out to us in any of the following channels, and include all the versions you're using.
Using the Intercom Messenger
Send an email to team@unflow.com
Validating your install
Upgrade to the latest version of
unflow-react-native
Upgrade to the latest version of React Native
Follow the troubleshooting steps for iOS
If you receive an error when trying to run pod install
that says 'The Swift pod unflow-react-native
depends upon React-Core
, which does not define modules' it means that your version of React Native did not natively support Swift. There are two resolutions:
You can upgrade to a version of React Native
>=0.63.4
Add
pod 'React-Core', :path => '../node_modules/react-native/', :modular_headers => true
to yourPodfile
Links don't open on iOS
The common Linking package for iOS by default exhibits some behaviour that causes Unflow URLs to not behave as expected.
The default code sample for linking looks like this:
// iOS 9.x or newer
#import <React/RCTLinkingManager.h>
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
return [RCTLinkingManager application:application openURL:url options:options];
}
This causes any URL that isn't a deeplink to be captured by your app, so when a user taps an Unflow button with a standard URL, for example, "https://www.google.co.uk", the app will capture it and do nothing.
In order to get around this, you'll have to make sure this method returns false for any given URL that your app is not supposed to capture. A simple way to do this is the following snippet, which ensures that any "http" or "https" URL is rejected by your app.
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
if ([url.scheme isEqual: @"http"] || [url.scheme isEqual: @"https"]) {
return NO;
}
return [RCTLinkingManager application:application openURL:url options:options];
}
Alternativley, you can reverse this logic, and only pass the URL to RCTLinkingManager
if it contains your apps URL scheme.
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
if ([url.scheme isEqual: @"your-app"]) {
return [RCTLinkingManager application:application openURL:url options:options];
} else {
return NO;
}
}
My app crashes when I use Intercom and Unflow
The intercom SDK for Android, until recently, depended on some old major versions of SDK's we also depend on. Specifically, these were Jetpack Compose and Coil.
Intercom android versions 12.3.0
through to the latest 12.4.2
should behave as expected. If your app uses an older version of intercom, you will see a crash when images are loaded within the intercom sdk.
Intercom react native version 3.0.5
depends on Intercom android 12.4.2
, so we reccomend using at least that version.
You will also need to ensure you have at absolute minimum a build tools of 4.0.1
.