Rajeev Kannav Sharma

Posts About

ionic appCache HTML5

05 Sep 2015

Recently I worked on IonicApp, AppCache @ HTML5 and thought it to update application assets in cache without updating app to Stores.

Requirements

  • Deploy an Ionic App to Heroku Refer last blog
  • Ionic app that display webView of server√

update config.xml

update html tag on serving/Remote App
<html manifest="remote.appcache">
Setup manifest to remote, carefully list files
CACHE MANIFEST
# v2.9.901
/lib/ionic/css/ionic.css
/css/style.css
/lib/ionic/js/ionic.bundle.js
/js/app.js
/index.html
/#/


#CACHE:
/lib/ionic/css/ionic.css
/css/style.css
/lib/ionic/js/ionic.bundle.js
/js/app.js
/index.html
#/#

#NETWORK:
#*
 # nothing yet

FALLBACK:
#/index.html
 # nothing yet

considered Server address is http://appcacheionic.herokuapp.com, do following changes to your Ionic App

at config.xml
  <content src="https://appcacheionic.herokuapp.com"/>
at index.html
    <script>
      function onBodyLoad()
      {
        document.addEventListener("deviceready", function(){
          //one of these ip-addresses is normally used to address the host machine when using genymotion
          location.href = "https://appcacheionic.herokuapp.com/";
        }, false);
      }
    </script>

Do changes to application assets, kill application at simulator/device. Be careful on updating app, Cache Limits

And if you get stuck… Ask Here

email me rajeevsharma86@gmail.com

Tweet to me at @rajeevkannav.