@hopqo/react-native
v0.1.1
Published
Hopqo deep links, deferred deep linking and install attribution for React Native
Downloads
575
Maintainers
Readme
@hopqo/react-native
Deep links, deferred deep linking and install attribution for React Native, with Hopqo.
npm install @hopqo/react-native
cd ios && pod installUse
import { Hopqo } from "@hopqo/react-native";
// Once, at startup. Resolves with the link that opened the app, including after a fresh install.
const first = await Hopqo.init({ key: "pk_…", domains: ["yourapp.hopqo.link"] });
if (first.link) navigate(first.link.deep_link, first.link.data);
// Links tapped while the app is running.
Hopqo.onLink((link) => navigate(link.deep_link, link.data));
// After sign-in, so later events from your backend are credited to the same link.
Hopqo.identify(user.id, { name: user.name, email: user.email }); // contact details only if enabled for the app
// Conversions.
Hopqo.track("sip_started", { fund: "bluechip" }, 500);Find your publishable key under Developers in the Hopqo dashboard.
App setup
- iOS: add
applinks:<your link domain>under Signing & Capabilities → Associated Domains. - Android: add an intent filter with
android:autoVerify="true"forhttps://<your link domain>to your main activity.
The dashboard's App setup page shows the exact values and checks that the domain files are served.
Native code is linked automatically (React Native 0.72 and later).
