'Flash update in Ionic 5
We have several apps in a production environment with a Convertigo Server 7.4. We are using flash update, and the ionic framework, but with our own ui components. We have a convertigo project in ionic 3 and angular 5, using flash update that works correctly. Currently, we have migrated to Convertigo Server 7.7, ionic 5 and angular 8, but the update with flash update after migration does not work correctly.
We have enabled flash update in the proyect, we have included the flash update files, and made it the default start html in the cordova config.xml
So when the app launches, it loads the flash update page, it checks for updates, comparing files and download files in the folder "file:///data/user/0/es.rtve.omnia.gen/files/www/flashupdate" when this finish, call to window.location.href = this.webview.convertFileSrc('file:///data/user/0/es.rtve.omnia.gen/files/www/flashupdate/index.html'); and reload app with url “localhost/app_file/data/user/0/es.rtve.omnia.gen/files/www/flashupdate/index.html” but it doesn't read the updated files.json file, but the same as the first time “http://localhost/files.json"
In the previous version the file protocol is used and now the http protocol is used.
What can we do to make it work with ionic 5?
Solution 1:[1]
If I understand, this is a Convertigo Angular SDK application and not a Mobile Builder application. You are not using Convertigo Studio for the Front end part, but you build by yourself the UI client using your own IDE and include Convertigo SDKs, is this correct ?
If yes, Convertigo does not officially support FlashUpdate with these type of applications although it should theoretically work, but this has never been tested..
Normally flashupdate is agnostic from Ionic or Angular as this process is done at startup completely independently from the app itself, so the problem is most probably not about Ionic 5 or Angular but more about the flashsupdate.js file version itself...
How do generate the files.json file ? do you use the "Get Source Package" button in the test platform ?
Solution 2:[2]
That is, we do not use Mobile builder, but in the previous version of our application, flashupdate worked.
Yes, the files.json file is obtained from the zip that generates "Get Source Package"
On Android with ionic 3 in the init method of file flashupdate.js, the value of “var url = window.location.href.replace (F.reTailUrl, "$1/files.json”);” is "file:///android_asset/www/files.json" and with ionice 5 the value is “http://localhost/files.json”
Before “all cordova files writen” I have had to change this “window.location.href = F.env.webLocalBase + "/index-fu.html”;” by “window.location.href = window.Ionic.WebView.convertFileSrc(F.env.webLocalBase + "/index-fu.html”);” because the first option showed “Not allowed to load local resource: file:///data/data/es.rtve.omnia.gen/files/www/flashupdate/index-fu.html”
Now reload window with "http://localhost/_app_file_/data/data/es.rtve.omnia.gen/files/www/flashupdate/index-fu.html" and you get again in "var url = window.location.href.replace (F.reTailUrl, "$1/files.json”) -> http://localhost/files.json”
So the only difference I see is the angular and ionic version, which used the file protocol before for android and now the http protocol
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Bossanova |
Solution 2 |