-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotifications.js
96 lines (56 loc) · 1.7 KB
/
notifications.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
const myNotification = new Notification('Title', {
body: 'Lorem Ipsum Dolor Sit Amet'
})
myNotification.onclick = () => {
console.log('Notification clicked')
}
function textNotification(message){
console.log(message);
let sender = message.messageSenderName;
let cont = message.messageContent;
const myNotification = new Notification(sender, {
body: cont,
icon: "test.png"
})
myNotification.onclick = () => {
console.log('Notification clicked')
}
}
function meetNotifcation(message){
console.log(message);
let sender = message.name;
let cont = `Meeting scheduled for 10:47`;
const myNotification = new Notification("Click to add to calendar", {
body: sender + "wants to schedule a meeting",
icon: "test.png"
})
myNotification.onclick = () => {
let content = object.content;
let dateFirebase = message.dateF;
firebase.firestore().collection('users').doc(me).collection('calendar').add({
content,
timestamp:dateFirebase,
type:"meet",
})
}
}
function taskNotifcation(message){
let pname =message.messageSenderName;
let mcont = message.messageContent;
console.log(message);
const taskNotification = new Notification(pname + " " + "set you a task!", {
body: mcont,
icon: "test.png"
})
taskNotification.onclick = () => {
console.log('Notification clicked')
}
}
// function shareNotification(share){
// console.log(share);
// let link = share.messageContent;
// let sender = share.messageSenderName;
// const taskNotification = new Notification(sender + " " + "shared a file", {
// body: "Click to view file",
// })
// }