An Rails example app using Action Cable and Service Worker (Web Push Notification)
Live demo available: https://question-answer-nimbl3-growth.herokuapp.com/
- Action Cable
- Service Worker - Web push notification
- Firebase clound message
Create a new project on Firebase at https://console.firebase.google.com/
Get Server key
and Sender ID
for Firebase cloud messaging
at https://console.firebase.google.com/project/qa-nimbl3-growth/settings/cloudmessaging
Clone the repository
git clone [email protected]:nimbl3/action-cable-and-web-push-notification.git
Edit file public/manifest.json
, change gcm_sender_id
to your Sender ID
above
# public/manifest.json
{
"gcm_sender_id": <YOUR_SENDER_ID>
}
Edit file config/application.yml
- Change
FIRE_BASE_API_KEY
toyour server key
- Change
DB_HOST
toyour database host
- Change
DB_PORT
toyour database port
- Change
USERNAME
toyour database username
- Change
FIRE_BASE_API_KEY
toyour server key
# config/application.yml
development:
DB_HOST: "192.168.99.100"
DB_PORT: "5432"
USERNAME: "postgres"
FIRE_BASE_API_KEY: 'YOUR_SERVER_KEY'
rake db:setup
rails server
This project is Copyright (c) 2014-2018 Nimbl3 Ltd. It is free software, and may be redistributed under the terms specified in the LICENSE file.
This project is maintained and funded by Nimbl3 Ltd.
We love open source and do our part in sharing our work with the community! See our other projects or hire our team to help build your product.