Get the referrer URL of the installed app with Application
Other hooks — Usage — Changelog
expo install @use-expo/application expo-application
// full hook
const [installReferrer, getInstallReferrer] = useApplicationAndroidInstallReferrer();
// other options
useApplicationAndroidInstallReferrer({ get: false });
import { useApplicationAndroidInstallReferrer } from '@use-expo/application';
import React from 'react';
import { Text, View } from 'react-native';
function ApplicationAndroidInstallReferrerExample() {
const [installReferrer] = useApplicationAndroidInstallReferrer();
return (
<View>
<Text>Install referrer: {installReferrer || '-'}</Text>
</View>
);
}
function useApplicationAndroidInstallReferrer(options?: Options): Result;
interface Options {
/** If it should fetch the application install referrer when mounted, defaults to `true` */
get?: boolean;
}
type Result = [
/** The current application install referrer */
string | undefined,
/** Callback to manually get the application install referrer */
() => Promise<void>,
];
with ❤️ byCedric