0.1.2 • Published 1 month ago

capacitor-plugin-version v0.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

capacitor-plugin-version

Can realize forced and non-forced updates of APP

Install

npm install cordova-plugin-apkupdater
npm install capacitor-plugin-version
npx cap sync

API

checkUpdates(...)

checkUpdates(options: { url: string; appid: string; version: string; }) => Promise<void>

更新程序启动器 在网页开始加载时使用

ParamType
options{ url: string; appid: string; version: string; }

getVersion()

getVersion() => Promise<string>

获取版本信息

Returns: Promise<string>


How to Use

  1. Get Version Number: Utilize the @capacitor/app package to obtain the version number.

  2. 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.

0.1.2

1 month ago

0.1.1

2 months ago

0.1.0

3 months ago