Jonathan
Jonathan

Reputation: 417

Debugging mobile push notifications using service workers

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

Answers (1)

Dhruv Batheja
Dhruv Batheja

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

Related Questions