UNPKG

react-native-rn-in-app-update

Version:

A minimal React Native module that displays the native Android in-app update popup using the Play Core library. Supports both immediate and flexible update types.

32 lines 1.31 kB
import type { UpdateInfo, UpdateType } from './types'; export * from './types'; /** * Shows the native Android in-app update popup using the Play Core API. * * @param type - (Optional) The update type to use: * - `'immediate'` (default): Forces the user to update immediately before continuing. * - `'flexible'`: Allows the user to continue using the app while the update is downloaded in the background. * * @returns A Promise that resolves when the update flow is started, or rejects if not available or fails. */ export declare const showUpdatePopup: (type?: UpdateType) => Promise<void>; /** * Gets metadata about the available update from the Play Store. * * @returns A promise that resolves with update info, or rejects on error or unsupported platform. */ export declare const getUpdateInfo: () => Promise<UpdateInfo | null>; /** * Starts a flexible update and listens for download progress. * Emits progress events via DeviceEventEmitter. */ export declare const startFlexibleUpdateWithProgress: () => Promise<void>; /** * Subscribes to update progress events */ export declare const subscribeToUpdateProgress: (callback: (progress: { status: number; bytesDownloaded: number; totalBytesToDownload: number; }) => void) => () => void; //# sourceMappingURL=index.d.ts.map