@abitofsoftware/capacitor-check-app-update 中文文档教程

发布于 4年前 浏览 20 项目主页 更新于 3年前

Capacitor Check App Update

检查 App 和 Play 商店以获取应用程序更新!

Installation

```shell 脚本 npm install --save @abitofsoftware/capacitor-check-app-update

#### Android
Add the plugin to the MainActivity in the Android project

import com.abitofsoftware.checkappupdate.CheckAppUpdatePlugin;

公共类 MainActivity 扩展 BridgeActivity { @覆盖 public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

// Initializes the Bridge
this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
  // Additional plugins you've installed go here
  add(CheckAppUpdatePlugin.class);
}});

} }

### iOS
If your app is only available in certain countries, you should add the (generic) locale option (e.g. Netherlands = `'nl'`)'.

### Usage

_ 从“@abitofsoftware/capacitor-check-app-update”导入{CheckAppUpdate}; const checkAppUpdate = new CheckAppUpdate();

checkAppUpdate.canUpdate({locale: 'nl'}) // 如文档中所述,仅在必要时填写语言环境。 .then((updateAvailable) => { 如果(updateAvailable.value){ console.log('更新可用!'); } 别的 { console.log('没有可用更新'); } }); ```

Capacitor Check App Update

Check the App and Play store for app updates!

Installation

```shell script npm install --save @abitofsoftware/capacitor-check-app-update

#### Android
Add the plugin to the MainActivity in the Android project

import com.abitofsoftware.checkappupdate.CheckAppUpdatePlugin;

public class MainActivity extends BridgeActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

// Initializes the Bridge
this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
  // Additional plugins you've installed go here
  add(CheckAppUpdatePlugin.class);
}});

} }

### iOS
If your app is only available in certain countries, you should add the (generic) locale option (e.g. Netherlands = `'nl'`)'.

### Usage

angularjs import {CheckAppUpdate} from "@abitofsoftware/capacitor-check-app-update"; const checkAppUpdate = new CheckAppUpdate();

checkAppUpdate.canUpdate({locale: 'nl'}) // Only fill in the locale if necessary as mentioned in the docs. .then((updateAvailable) => { if (updateAvailable.value) { console.log('Update available!'); } else { console.log('No update available'); } }); ```

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文