react-native-webview. It does three things:
- It wraps one existing analytics
trackclient so UserJourneys can observe selected app events. - It shows a native prompt before starting an event-triggered or synced-audience interview.
- It resolves UserJourneys HTTPS invite links from Intercom, email, push, or any other channel.
Install
@userjourneys/interviews-react-native; react-native-webview
is listed separately because it is a native module linked into your app binary.
Expo Go can run JavaScript-only app code, but a production integration should be
validated in the same development build, EAS build, or bare React Native app
that users receive so WebView, deep links, and microphone permissions match the
release build.
Add microphone permissions
The in-app interview runs inreact-native-webview, but voice capture still
uses native app permissions.
For iOS, add NSMicrophoneUsageDescription to the app Info.plist.
For Android, add both permissions to the app manifest:
android.permissions and
ios.infoPlist in app config.
Get your SDK key
In the dashboard, go to Settings → API keys and copy the Interviews SDK key. This public key is the only credential the mobile SDK needs. Pass it aspublicKey when you create the client below.
Create the client
Create the UserJourneys client next to your central analytics setup. If that client exposestrack(eventName, properties), wrap it once.
analytics.ts
You do not need to update every existing
track call. Wrap the single analytics
client your app already imports, then keep calling that client normally.interviews.track(eventName, properties)
from the same central analytics helper.
Mount the host once
Render the host once near your app root. Eligible analytics events and synced audience matches show the built-in native prompt first. Accepted prompts and explicit invite links open the interview in-app.AppRoot.tsx
referenceId matches an active audience member connected to a Study Launch
Rule, the SDK receives a pending invite during config load and shows the
prompt.
Keep tracking normally
Your app keeps calling analytics as it does today.CheckoutCompleteButton.tsx
Linking.openURL.
Which events and audiences launch an interview is controlled by Study Launch
Rules in the dashboard. See Study Launch Rules to
create and target them.
If your central analytics client is Mixpanel, see the
Mixpanel setup.
Handle HTTPS invite links
Configure Universal Links/App Links forhttps://app.userjourneys.ai/i/* and
https://app.userjourneys.ai/interviews/*, then pass incoming URLs to the SDK.
UserJourneys also needs to authorize your app from the app.userjourneys.ai
domain before those HTTPS links can open your installed app. Provide these app
identifiers:
- Apple Team ID and iOS bundle ID.
- Android application ID and the SHA-256 signing certificate fingerprint for each release signing key that should open links.
links.ts