Skip to main content

Add to Home Screen

The first chapter in building progressive web apps (PWA).


Progressive Web Apps are booming fast and all most all major apps are coming up with respective web app. Because web platform is becoming so universal that replicates app like behavior and objective that we want to achieve with Andriod/iOS app could be achieved with web browser itself. Add to home screen is a modern feature that enables us to add shortcut in device's home screen So why not give it a try.


Requirements :
  1. Manifest.json file
  2. Service worker
Time : 5 Minutes
Coffee : Just a cup is enough.


STEP 1

Create the HTML page (index.html)


STEP 2

Create a manifest file with json extension (manifest.json)


NOTE : A valid PNG icon should be available having at least 144px resolution


STEP 3

Write the code for service worker in .js extension (service-worker.js)


STEP 4

Sip your coffee and get prepared for next step. Not tough though, nothing to fear Ashiq will guide you well.


STEP 5

Link the manifest.json file that we created in STEP 2 with the html page (index.html). Just like any stylesheet or metatag paste this code in head section



STEP 6

Check and register the service worker. Add a script tag anywhere in html page (before ending body tag is prefered) and put the code as below.


NOTE : Service worker works only in https protocol, So be sure to use a secure server certificate. If something goes wrong just open the console(Ctrl + Shift + I) you will get to see the error message.


Check and download source code  from this link https://xbytelab.com/project/add_to_home_screen

Comments

Popular posts from this blog

Windows 10 will be released to all WP8 Lumia phones

Windows 10 will be released to all WP8 Lumia phones 25 march, 2015 Tags:  Microsoft ,  Nokia ,  Windows Phone ,   Firmware update, windows phone 10  We have some wonderful news to all Lumia owners around the world. Today Microsoft announced via its Twitter account that all Windows Phone 8-based Lumia smartphones will be treated to the upcoming Windows 10 OS next year.   The next iteration of Windows was announced recently and it will unify the Windows OS and make it compatible to phones, tablets and PCs with just one installation. Windows 10 is coming sometime next year and it is currently in development.   It's really good news to see Microsoft updating even three-year old phones with less RAM to the latest Windows OS. We know Microsoft's decision to ditch all WP7 phones when switching to WP8 was a huge blow to the fans and the Windows Phone OS popularity itself. But apparently Microsoft has learned a valuable lesson sinc...

YouWave Home 4.1.1 Crack

YouWave Home 4.1.1 Crack is Here !  (100% Working ) YouWave for Android 4.1.1  - The Android Emulator YouWave  is a software which is used to run the android apps in your computer and its also used to play games i.e., android games with the Desktop or laptop using YouWave .Playing with the Android emulator on your computer is a pretty geeky endeavor, but YouWave makes it easy to accomplish on your Windows PC. If you can download and install a Windows program, you can have an Android virtual machine running on your desktop in just a few minutes. Probably this is the best alternative for BlueStacks.But YouWave won’t launch most of the games like Temple Run,Subway Surfers etc. while you can play them on BlueStacks. YouWave Universal Crack ?  :  YouWave Universal Crack is Here ! YouWave Features Runs Android apps and app stores on your PC, no phone required Download thousands of apps online via app stores within youwave High performance – ...