App Update
This plugin does self-update for android
联系我们?
If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic's experts offer official maintenance, support, and integration help.
Ionic 应用更新 App Update插件的安装(Installation)
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More or Contact Us
Ionic 应用更新 App Update插件支持的平台(Supported Platforms)
- Android
Ionic 应用更新 App Update插件的用法(Usage)
You should first host an XML file on your server with the following data in it:
<update>
<version>302048version>
<name>APK Namename>
<url>https://your-remote-api.com/YourApp.apkurl>
update>
Then use the following code:
import { AppUpdate } from '@ionic-native/app-update/ngx';
constructor(private appUpdate: AppUpdate) {
const updateUrl = 'https://your-remote-api.com/update.xml';
this.appUpdate.checkAppUpdate(updateUrl).then(() => { console.log('Update available') });
}
The plugin will compare the app version and update it automatically if the API has a newer version to install.