-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DO u have andy demo code? I don't understand how to use this plugin thanks! #14
Comments
Sorry for the late reply. I overlooked the notification. Yes, I admit the readme is a bit overkill. Create an empty cordova project: cordova create Test com.example.id ApkUpdater
cd Test
cordova plugin add cordova-plugin-apkupdater
cordova platform add android
cordova run android --emulator JS Code: // This is optional, but is helpful to debug errors.
cordova.plugins.apkupdater.setObserver(
{
downloadProgress: console.log,
exception: console.error
}
);
await cordova.plugins.apkupdater.check('https://raw.githubusercontent.com/kolbasa/cordova-plugin-apkupdater-demo/master/update'); // you can ignore the result, if you already know, that you need this update
await cordova.plugins.apkupdater.download();
await cordova.plugins.apkupdater.install(); JS Code with callbacks: // This is optional, but is helpful to debug errors.
cordova.plugins.apkupdater.setObserver(
{
downloadProgress: console.log,
exception: console.error
}
);
cordova.plugins.apkupdater.check(
'https://raw.githubusercontent.com/kolbasa/cordova-plugin-apkupdater-demo/master/update,
function (oVersion) { // you can ignore the result, if you already know, that you need this update
cordova.plugins.apkupdater.download(
function () {
cordova.plugins.apkupdater.install(console.log, console.error);
},
console.error
);
},
console.error
); EDIT: Fixed typo in last code block |
Thanks, i have one more question about check() And I see the intro,do I have to unzip the apk? |
You need to compress the update with my script: Example:
The Plugin can't read your version.xml. |
DO u have any demo code? I don't understand how to use this plugin thanks!
The text was updated successfully, but these errors were encountered: