https://github.com/mskian/subscribe-auth-push
A Simple Static Site with Web Auth Build Using Firebase for Web Push Notification.
https://github.com/mskian/subscribe-auth-push
cloudmessaging css firebase firebase-auth firebase-database firebase-realtime-database html html5 javascript push-notifications
Last synced: 12 months ago
JSON representation
A Simple Static Site with Web Auth Build Using Firebase for Web Push Notification.
- Host: GitHub
- URL: https://github.com/mskian/subscribe-auth-push
- Owner: mskian
- License: mit
- Created: 2020-08-13T11:43:57.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-27T06:15:15.000Z (almost 6 years ago)
- Last Synced: 2025-03-27T09:51:51.872Z (about 1 year ago)
- Topics: cloudmessaging, css, firebase, firebase-auth, firebase-database, firebase-realtime-database, html, html5, javascript, push-notifications
- Language: JavaScript
- Homepage:
- Size: 78.1 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Web Push Notification
A Simple Static Site with Web Auth Build Using Firebase for Web Push Notification.
## Requirements
- Firebase project
- Firebase Project Web SDK -
- Enable Google Firebase web Auth -
- Firebase Realtime Database -
## Features
it is Pure Static site Built Using
- HTML
- CSS
- Javascript
you can Hosted it Freely on Github pages and Netlify
## Setup
- Download or Clone this Repo Files to your Server
- Create new Firebase project -
- Setup Project for Web app and Open `app.js` File and add your Firebase Project Web SDK
- Next Goto **Authentication** in Sign-in providers Enable the Google Sign-in Method
- Add your Domain to Authorized domains you can find this Option on elow the Sign-in Method tab
- Next Goto Realtime Databse - Create New database and Update the Database Rules
- Add this Below Rules on Database Rules Section
```json
{
"rules": {
"users": {
"$uid": {
".read": "$uid === auth.uid",
".write": "$uid === auth.uid"
}
},
"userstoken": {
"$uid": {
".read": "$uid === auth.uid",
".write": "$uid === auth.uid"
}
}
}
}
```
- Save and Publish the Rules
- That's all Our Site Setup is Done - Sign-in with your Google Account and Test the Site
## Send Push Notifications
Currently i am working on Custom Dashboard for Sending Push notifications
you can send Push Notification via cURL -
```sh
curl -X POST -H "Authorization: -H "Content-Type: application/json" -d '{
"notification": {
"title": "Hello World",
"body": "Test Push",
"icon": "https://subscribe.example.com/assets/icons/Icon-48.png",
"click_action": "https://example.com"
}
"to": ""
}' "https://fcm.googleapis.com/fcm/send"
```
## LICENSE
MIT