File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,9 @@ Getting Started
25
25
notifications to the browser.
26
26
5 . Use the generated Instance ID token to send an HTTP request to FCM that
27
27
delivers the message to the web application, inserting appropriate values
28
- for YOUR-SERVER-KEY and YOUR-IID-TOKEN.
28
+ for [ YOUR-SERVER-KEY] ( https://console.firebase.google.com/project/_/settings/cloudmessaging )
29
+ and YOUR-IID-TOKEN.
30
+
29
31
### HTTP
30
32
```
31
33
POST /fcm/send HTTP/1.1
@@ -43,6 +45,7 @@ Content-Type: application/json
43
45
"to": "YOUR-IID-TOKEN"
44
46
}
45
47
```
48
+
46
49
### cURL
47
50
```
48
51
curl -X POST -H "Authorization: key=YOUR-SERVER-KEY" -H "Content-Type: application/json" -d '{
@@ -55,6 +58,7 @@ curl -X POST -H "Authorization: key=YOUR-SERVER-KEY" -H "Content-Type: applicati
55
58
"to": "YOUR-IID-TOKEN"
56
59
}' "https://fcm.googleapis.com/fcm/send"
57
60
```
61
+
58
62
- When the app has the browser focus , the received message is handled through
59
63
the ` onMessage ` callback in index.html. When the app does not have browser
60
64
focus then the ` setBackgroundMessageHandler ` callback in firebase-messaging-sw.js
29DC
You can’t perform that action at this time.
0 commit comments