-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsendMsg.js
56 lines (54 loc) · 1.7 KB
/
sendMsg.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
export function sendMsg(token, name, value) {
fetch("https://fcm.googleapis.com/fcm/send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "key=AAAAW6bQhAY:APA91bGbLAf4KT_ZvwgrObTIxZOUmDNlUl_8PjmjGWoS1dabE1RUMJTc8uJ88hIa3QBr6WALkD-dNPDk9Qu33r6nG8lz0GulLusHlvSC_op23uQ8DjUx88_Rv0UBKuxMbGcAT8omx2bX"
},
body: JSON.stringify(
{
"to": token,
"notification": {
"title": "Coin Price Notice",
"body": `${name}이 ${value}원에 도달했습니다.`
}
}
)
})
}
export function sendMsg1(token, name, value) {
fetch("https://fcm.googleapis.com/fcm/send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "key=AAAAW6bQhAY:APA91bGbLAf4KT_ZvwgrObTIxZOUmDNlUl_8PjmjGWoS1dabE1RUMJTc8uJ88hIa3QBr6WALkD-dNPDk9Qu33r6nG8lz0GulLusHlvSC_op23uQ8DjUx88_Rv0UBKuxMbGcAT8omx2bX"
},
body: JSON.stringify(
{
"to": token,
"notification": {
"title": "Coin Price Notice",
"body": `${name}이 ${value}%에 급등했습니다.`
}
}
)
})
}
export function sendMsg2(token, name, value) {
fetch("https://fcm.googleapis.com/fcm/send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "key=AAAAW6bQhAY:APA91bGbLAf4KT_ZvwgrObTIxZOUmDNlUl_8PjmjGWoS1dabE1RUMJTc8uJ88hIa3QBr6WALkD-dNPDk9Qu33r6nG8lz0GulLusHlvSC_op23uQ8DjUx88_Rv0UBKuxMbGcAT8omx2bX"
},
body: JSON.stringify(
{
"to": token,
"notification": {
"title": "Coin Price Notice",
"body": `${name}이 ${value}%에 급락했습니다.`
}
}
)
})
}