gdg-x / zeppelin

Awesome conference website in 5 minutes.
http://gdg-x.github.io/zeppelin/
MIT License
678 stars 933 forks source link

Install banner #69

Closed tasomaniac closed 9 years ago

tasomaniac commented 9 years ago

Install banner feature is added as can be seen on the screenshot on #67

More info about this can be found on http://updates.html5rocks.com/2015/03/increasing-engagement-with-app-install-banners-in-chrome-for-android

To test this: Install Chrome Beta for Android and have this flag enabled chrome://flags/#bypass-app-banner-engagement-checks

tasomaniac commented 9 years ago

Here is a video for you :) Install App Banner on Project Zeppelin: https://youtu.be/AEfC8jpz6cY

ozasadnyy commented 9 years ago

Thanks for the video, but I have two questions:

  1. Why we need to include service-worker.js? It's blank.
  2. I have noticed that it will appear even if you have already added to the home screen
tasomaniac commented 9 years ago

service worker is required by the Google Chrome team. It is kinda for developers to implement some sort of offline caching behavior. For example images, JS and css files can be easily cached in the worker.

The behavior is decided by the Chrome itself. It is in beta right now. They may change when they show it in the future. Are you sure that if it is asking even you have the shortcut?

On Sat, Mar 14, 2015, 4:39 PM Oleh Zasadnyy notifications@github.com wrote:

Thanks for the video, but I have two questions:

  1. Why we need to include service-worker.js? It's blank.
  2. I have noticed that it will appear even if you have already added to the home screen

— Reply to this email directly or view it on GitHub https://github.com/gdg-x/zeppelin/pull/69#issuecomment-80511713.

ozasadnyy commented 9 years ago

I know what sw is, but have you tried to define scripts.js instead of blank service-worker.js here:

navigator.serviceWorker.register('{{ site.baseurl }}/service-worker.js', {scope: '{{ site.baseurl }}/'})

Because it's additional request.

And why have deleted twitterFeed: "" link?

tasomaniac commented 9 years ago

I shouldn't delete the twitterFeed. I deleted it during test because it doesn't use https. I accidentally pushed it. Sorry.

I didn't try to include scripts.js there. Are you talking about the scripts.min.js? Examples were using separate js files for service-workers. Idk what is the right way to do it. :) Guide me :)

tasomaniac commented 9 years ago

So, I've added service-worker registration at the end. The older implementation is from a sample from Google. I've also look at the io2015 implementation. They included service registration code into their scripts file. They have a separate service-worker.js file. And they register it after the first animation of the website is finished. https://events.google.com/io2015/scripts/site-scripts.js

ozasadnyy commented 9 years ago

Ok, let's merge it into devep branch and I will look to it.