react-native-fluq
Version:
Firebase Dynamic Links alternative for React Native
39 lines (38 loc) • 1.24 kB
TypeScript
export interface DynamicLinkParams {
[key: string]: string;
}
export interface DynamicLinkResult {
url: string;
params?: DynamicLinkParams;
minimumAppVersion?: string;
}
export default class DynamicLinks {
/**
* Get the initial dynamic link that opened the app
*
* @returns Promise that resolves to the dynamic link or null if none
*/
static getInitialLink(): Promise<DynamicLinkResult | null>;
/**
* Add a listener for dynamic links while the app is running
*
* @param listener The callback function that will receive dynamic link data
* @returns Function to unsubscribe the listener
*/
static onLink(listener: (dynamicLink: DynamicLinkResult) => void): () => void;
/**
* Create a dynamic link with parameters
*
* @param options The options for creating a dynamic link
* @returns Promise that resolves to the created dynamic link
*/
static createDynamicLink(options: {
link: string;
domainUriPrefix: string;
androidPackageName?: string;
androidFallbackLink?: string;
iosBundleId?: string;
iosFallbackLink?: string;
params?: DynamicLinkParams;
}): Promise<string>;
}