-
Notifications
You must be signed in to change notification settings - Fork 102
/
Copy pathpush.sh
35 lines (31 loc) · 930 Bytes
/
push.sh
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
#!/usr/bin/env bash
#####
# Sends a push notification to a specific device
#
#####
# celo-mobile-alfajores
# https://console.firebase.google.com/project/celo-mobile-alfajores/settings/cloudmessaging/ios:org.celo.mobile.alfajores
FCM_SERVER_KEY=""
# to get your token you can add a log in src/firebase/firebase.ts registerTokenToDb
USER_FCM_TOKEN=""
curl -X POST --header "Authorization: key=$FCM_SERVER_KEY" \
--Header "Content-Type: application/json" \
https://fcm.googleapis.com/fcm/send \
-d '{
"notification": {
"title": "Test Title",
"body": "Tap this to be redirected to celo.org"
},
"android": {
"ttl": 604800000,
"priority": "normal",
"notification": {
"icon": "ic_stat_rings",
"color": "#42D689"
}
},
"data": {
"ou": "https://celo.org"
},
"to": "'"$USER_FCM_TOKEN"'"
} '