Reputation: 417
I am trying to implement push notifications to mobile users that are using only browser (no dedicated mobile app). It is possible to do that using service-worker: https://developers.google.com/web/updates/2015/03/push-notifications-on-the-open-web
The problem is that I can't test it. service-worker requires https or localhost. I don't have https nor a domain, so I have only localhost.
I tried to set hosts file in my android, so my ip will be pointed by localhost - but I don't have root access, so I can't change the hosts file.
I tried to use emulator - but "localhost" is the local device. the container machine is 10.0.2.2 .
So my question is - how can I test push notifications using service-worker localy?
Upvotes: 2
Views: 788
Reputation: 2360
Host your page on GitHub Pages. It is free and easy to use and will give you an HTTPS domain for your testing. Cheers!
Upvotes: 4