Skip to content
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

support for ionic 5 #39

Closed
l0ft13 opened this issue Nov 23, 2021 · 1 comment
Closed

support for ionic 5 #39

l0ft13 opened this issue Nov 23, 2021 · 1 comment

Comments

@l0ft13
Copy link

l0ft13 commented Nov 23, 2021

I have tried to use your plugin with ionic 5 / capacitor and it is failing on build.

./src/app/app.module.ts:25:106-116 - Error: export 'ApkUpdater' (imported as 'ApkUpdater') was not found in 'cordova-plugin-apkupdater' (possible exports: default)

thanks

@kolbasa
Copy link
Owner

kolbasa commented Nov 23, 2021

It works for me.

Blank project:

ionic start test blank --type=angular --capacitor --no-interactive
cd test/
npm install cordova-plugin-apkupdater
ionic cap sync
ionic cap open android

ionic info

   Ionic CLI                     : 6.18.1
   Ionic Framework               : @ionic/angular 5.9.1
   @angular-devkit/build-angular : 12.1.4
   @angular-devkit/schematics    : 12.2.13
   @angular/cli                  : 12.1.4
   @ionic/angular-toolkit        : 4.0.0

src/app/home/home.page.ts

import {Platform} from '@ionic/angular';
import {Component} from '@angular/core';

import ApkUpdater from 'cordova-plugin-apkupdater';

@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})

export class HomePage {

  remote = 'https://raw.githubusercontent.com/kolbasa/cordova-plugin-apkupdater-demo/master/update';

  constructor(public platform: Platform) {
    platform.ready().then(this.update.bind(this)).catch(console.error);
  }

  async update() {
    await ApkUpdater.download(
        this.remote + '/update.zip',
        {
          zipPassword: 'aDzEsCceP3BPO5jy',
          onDownloadProgress: progress => console.log(progress),
          onUnzipProgress: progress => console.log(progress)
        }
    );
    await ApkUpdater.install();
  }

}

@kolbasa kolbasa closed this as completed Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants