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

Download Again / Install Manually when run with the Kiosk cordova plugin #136

Open
sealover06 opened this issue Jul 19, 2019 · 4 comments
Open

Comments

@sealover06
Copy link

sealover06 commented Jul 19, 2019

Hello Vaenow and team. Let me start: this plugin is awesome. Works like a charm.

I can just see 1 issue when run as well with the kiosk plugin.
and this case and only this case, I get a Download Again / Install Manually popup that is stuck on the screen.

From similar issues, I've seen that a way to fix this was to add

uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" in the AndroidManifest.xml

But I've checked, and yes, I have already this line...

uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"

uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"

uses-permission
android:name="android.permission.REQUEST_INSTALL_PACKAGES"

uses-permission
android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"

uses-permission
android:name="android.permission.REORDER_TASKS"

uses-permission
android:name="android.permission.SYSTEM_ALERT_WINDOW"

Omitted the tags since interpreted by the editor.

My Tablet runs android 6.0.1

Thanks for help, I really need both plugin to work together. Thanks a lot in advance, Cheers, Denys

@carlo318
Copy link

Hi @sealover06 I also use both those plugins in an app, on Android 6.0.
I have seen that it is necessary to disable temporarily the kiosk mode to let the plugin-app-update do its work (stop, update, restart). The risk is that the user could be asked to confirm again that the app must be in kiosk mode (primary launch application).
Another way could be to force stopping the app, so the update can proceed.
It happend to me that the callback event after app-update does not work, so I added a timeout to force stopping the app one minute after finding out that the app needs update.

@sealover06
Copy link
Author

sealover06 commented Jul 20, 2019 via email

@sealover06
Copy link
Author

sealover06 commented Jul 21, 2019

Well, I'm not sure that I can deal with cordova-plugin-kiosk. the KioskPlugin.exitKiosk() function leads to a popup "Select destination Launcher3 / myApp" I'm looking for full automation here with no user click...

@vaenow, please any thoughts on the compatibility of your great app-update plugin with a kiosk plugin ? thank you so much in advance.

@carlo318, may you share your code for "a timeout to force stopping the app one minute after finding out that the app needs update" ? thank you !

@carlo318
Copy link

@sealover06 this is my example code, forcing Exit App and Stop Kiosk mode after 30sec:

var updateUrl = "https://myserver.com/version.xml";
// Get xml from server
$http.get(updateUrl, {}).success(function(xmlData, status) {
    // Check if App needs update by reading xml info
    if ($(xmlData).find('version').text() > window.localStorage['appVersionCode']) {
        // New version available: try to update
        window.AppUpdate.checkAppUpdate(function(result) {
            // Success
        }, function(err) {
            // Fail
            window.localStorage["Reboot"]="0";
        }, updateUrl, {
            'skipPromptDialog' : true,
            'skipProgressDialog' : true
        });
        $rootScope.NeedUpdate = true;
        // After 30 seconds disable Kiosk and Close App to allow autoUpdate
        $timeout(function() {
            Kiosk.setKioskEnabled(false);
            navigator.app.exitApp();
        }, 30000);
        window.localStorage["Reboot"]="1";  //Reboot at next App start
    } else {
        // App is up-to-date
        console.log('App is Up-to-date');
    }
}).error(function(data, status, headers, config) {
    console.log('CheckAppUpdate XML err: '  data);
});

It only work with "mild" kiosk mode: cordova-plugin-kiosk-launcher

Hope it helps.

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