@abitofsoftware/capacitor-check-app-update 中文文档教程
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'); } }); ```