Chrome Push API with AeroGear Unified Push Example
This sample is based on two articles from Google:
We suggest to read them both for better understanding of Push API, Service Worker and how it works in Google Chrome.
This video provides additional explanations and shows how it works in reality:
- Chrome 42+
- AeroGear UnifiedPush server
To make it workable you have to complete two steps:
- Set up your FCM/GCM Sender ID in manifest.json
- Set up Variant-ID, Variant-Secret and URL for your AeroGear UnifiedPush Server instance in main.js
For this sample you will need to run a local web server. You may already have your own setup for this. Otherwise open a terminal window, navigate to the current directory and run the following Python command to start a server:
python -m SimpleHTTPServer
This will start a web server on the default HTTP port. Open http://localhost:8000 from your Google Chrome to see the main page.