Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding FCM Notifications #133

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion assets/js/notifications.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
const publicVapidKey =
"BAK9aUUilxzljIZVaKm8gjt6MWYsXQFbhluMMCFCddHbWug4_H48Q4XtbCwBSPZ9V3wcNUGr92twrEbmGMyABKU";
const firebaseConfig = {
messagingSenderId: "254977934750"
apiKey: "AIzaSyCZ8gbWs9FLlzw93BOj_OQzlWwd_F1N-IY",
aarshad-devani marked this conversation as resolved.
Show resolved Hide resolved
authDomain: "pyconhyd.firebaseapp.com",
databaseURL: "https://pyconhyd.firebaseio.com",
projectId: "pyconhyd",
storageBucket: "pyconhyd.appspot.com",
messagingSenderId: "254977934750",
appId: "1:254977934750:web:9f1ad0357425e5718d828f"
};
firebase.initializeApp(firebaseConfig);
const messaging = firebase.messaging();
Expand Down
10 changes: 8 additions & 2 deletions firebase-messaging-sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ importScripts("https://www.gstatic.com/firebasejs/7.5.0/firebase-app.js");
importScripts("https://www.gstatic.com/firebasejs/7.5.0/firebase-messaging.js");

firebase.initializeApp({
messagingSenderId: "254977934750"
});
apiKey: "AIzaSyCZ8gbWs9FLlzw93BOj_OQzlWwd_F1N-IY",
authDomain: "pyconhyd.firebaseapp.com",
databaseURL: "https://pyconhyd.firebaseio.com",
projectId: "pyconhyd",
storageBucket: "pyconhyd.appspot.com",
messagingSenderId: "254977934750",
appId: "1:254977934750:web:9f1ad0357425e5718d828f"
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing brace here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added.. sorry :(

const messaging = firebase.messaging();
messaging.setBackgroundMessageHandler(function(payload) {
console.log(
Expand Down