capacitor-plugin-version
v0.1.4
Published
Can realize forced and non-forced updates of APP
Readme
capacitor-plugin-version
Can realize forced and non-forced updates of APP
Install
npm install cordova-plugin-apkupdater-skipssl
npm install capacitor-plugin-version
npx cap syncAPI
checkUpdates(...)
checkUpdates(options: { url: string; appid: string; version: string; }) => Promise<void>Update program launcher Used when the webpage starts loading
| Param | Type |
| ------------- | ------------------------------------------------------------- |
| options | { url: string; appid: string; version: string; } |
getVersion()
getVersion() => Promise<string>Get version information
Returns: Promise<string>
How to Use
Get Version Number: Utilize the
@capacitor/apppackage to obtain the version number.Invoke After Page Load: Call the
version.checkUpdates()function after the page has loaded, providing the following parameters:url: The URL to query for the latest version.appid: The unique identifier for the app.version: The version number of the app.
Example Usage:
import { App as CapacitorApp } from '@capacitor/app';
// Step One: Get Version Number
const versionNumber = CapacitorApp.getVersion();
// Step Two: Invoke After Page Load
version.checkUpdates({
url: 'URL for querying the latest version',
appid: 'Unique identifier for the app',
version: versionNumber,
});Remember to replace 'URL for querying the latest version' and 'Unique identifier for the app' with the actual values corresponding to your application.
Update Log
2025-07-08 v0.1.4
- Upgrade Gradle wrapper to version 8.2.1
- Modify build configuration to use internal Maven dependency repository
- Update Android build tools version to 8.2.1
- Adjust version number to 0.1.4 and update Chinese documentation
