Fetch the latest version from the play store and app store. Show update dialog (android) or open update in store (ios).
This modules uses AppUpdateManager
on android for checking for updates:
https://developer.android.com/guide/playcore/in-app-updates/kotlin-java#update-availability
This modules calls 'https://itunes.apple.com/lookup?bundleId=...' on iOS for checking for updates.
// Get information about the latest version of the app.
import { getAppUpdateInfo, doAppUpdate } from "expo-app-update";
const appUpdateInfo = await getAppUpdateInfo();
console.log('appUpdateInfo', appUpdateInfo);
// Show update dialog (only android)
if (appUpdateInfo.updateAvailable) {
await doAppUpdate();
}
// Open the app store page for the app (useful for iOS)
await openAppInStore();
```typescript
export interface AppUpdateInfo {
updateAvailable: boolean;
android?: AndroidInfo;
ios?: IosInfo;
}
export interface AndroidInfo {
availableVersionCode: number;
clientVersionStalenessDays: any;
installStatus: InstallStatus;
isUpdateTypeAllowed: boolean;
packageName: string;
updateAvailability: UpdateAvailability;
updatePriority: number;
}
export interface IosInfo {
version: string;
}
For managed Expo projects, please follow the installation instructions in the API documentation for the latest stable release. If you follow the link and there is no documentation available then this library is not yet usable within managed projects — it is likely to be included in an upcoming Expo SDK release.
For bare React Native projects, you must ensure that you have installed and configured the expo
package before continuing.
npm install expo-app-update
Run npx pod-install
after installing the npm package.
No additional steps are required for Android.
Contributions are very welcome! Please refer to guidelines described in the contributing guide.