0

I have implemented Direct Update in Ionic3 application. Direct Update notification has received, downloaded successfully but UI changes are not getting reflected in application.Please help.

Code Snippet:

declare var WL;
declare var wl_directUpdateChallengeHandler;


constructor(public platform: Platform){

 renderer.listenGlobal('document', 'mfpjsloaded', () => {
  console.log('--> MyApp mfpjsloaded');
    this.directUpdateHandler();
     this.checkWebUpdate();

    })

}
 checkWebUpdate(){
    console.log('--> checkWebUpdate called');
    WLAuthorizationManager.obtainAccessToken()
      .then(
        (accessToken) => {
          console.log('--> AuthHandler: obtainAccessToken onSuccess'+JSON.stringify(accessToken));
        },
        (error) => {
          console.log('--> AuthHandler: obtainAccessToken onFailure: ' + JSON.stringify(error));
        }
      );
  }

directUpdateHandler(){
    console.log('--> MyApp directUpdateHandler called');
     wl_directUpdateChallengeHandler.handleDirectUpdate = 
      function(directUpdateData, directUpdateContext) {
      WL.SimpleDialog.show('Update Avalible',' Press update button to 
      download new version', [{
        text :'update',
        handler : function() {
          directUpdateContext.start();
        }
      }]);
    };
  }
Abhee
  • 73
  • 1
  • 9

1 Answers1

0

Since you have missed implementing directUpdateCustomListener, You are facing this issue.

Two ways to solve this issue :

  • Try Direct Update feature without using directUpdateHandler function, it will work.

  • If you are planning to customise the UI for direct update, You have write full definition of the DU which includes implementation of directUpdateCustomListener as well. This is mentioned in the following documentation.

Vittal Pai
  • 3,317
  • 25
  • 36