0
votes

We are customizing the DirectUpdate process as in the documentation (https://www-01.ibm.com/support/knowledgecenter/SSHS8R_7.1.0/com.ibm.worklight.dev.doc/dev/c_customizing_direct_update_ui_android_wp8_ios.html - with a directUpdateCustomListener) but in the onFinish callback the status is FAILURE_UNZIPPING.

I am testing on an Android (5.1.1) emulator.

function wlCommonInit(){
    WL.Client.connect({
        onSuccess: function() {
            console.log("Successfully connected to Worklight Server.");
        }, onFailure: function() {
            console.log("Failed connecting to Worklight Server.");
        }
    });
}

var busyInd = new WL.BusyIndicator('content');
var savedDirectUpdateContext = null;
var restartDirectUpdate = function () {
    if (savedDirectUpdateContext != null) {
        savedDirectUpdateContext.start(directUpdateCustomListener); // use saved direct update context to restart direct update
    }
};

var directUpdateCustomListener = {
    onStart: function(totalSize) {
        busyInd.show();
    },
    onProgress: function(status, totalSize, completeSize) {},
    onFinish: function(status) {
        busyInd.hide();
        console.log("[MFP - DirectUpdate] Finish status: " + status);

        var posSuccess = status.indexOf("SUCCESS");
        if (posSuccess > -1) {
            WL.Client.reloadApp();
        } else {
            WL.SimpleDialog.show('Update Failed', 'Press try again button', [{
                text: "Try Again",
                handler: restartDirectUpdate // restart direct update
            }]);
            wl_directUpdateChallengeHandler.submitFailure();
        }
    }
};

wl_directUpdateChallengeHandler.handleDirectUpdate = function(directUpdateData, directUpdateContext) {
    savedDirectUpdateContext = directUpdateContext

            WL.SimpleDialog.show('Update Avalible', 'Press Update button to download the new version!', [{
                text : 'Update',
                handler : function() {
                    directUpdateContext.start(directUpdateCustomListener);
                }
            }, {
                text : 'Cancel',
                handler : function() {
                    wl_directUpdateChallengeHandler.submitFailure();
                }
            }]);
};

How can we fix this?

1
Provide the implementation and your expected scenario. - Idan Adar
Can you provide the server logs with the corresponding timestamp when the mentioned error has happened? - Idan Adar
Does direct update work fine , if you do not customize it? Trying to see if the customization is causing the issue - Vivin K

1 Answers

0
votes

The custom code is working fine without zxing installed. I suggest that you will try the same without this library. If it works, I suspect that it may be initializing or otherwise interfering with the Direct Update process once an update has been received.

Considering loading the library later in the app life cycle and see if this helps.