Skip to content

Commit

Permalink
Update README with usage
Browse files Browse the repository at this point in the history
  • Loading branch information
SpellChucker committed May 28, 2020
1 parent 33683d9 commit 859625a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ sender.send(message, { registrationTokens: registrationTokens }, 10, function (e
else console.log(response);
});

// Q: I need to remove all "bad" token from my database, how do I do that?
// Q: I need to remove all "bad" token from my database, how do I do that?
// The results-array does not contain any tokens!
// A: The array of tokens used for sending will match the array of results, so you can cross-check them.
sender.send(message, { registrationTokens: registrationTokens }, function (err, response) {
sender.send(message, { registrationTokens: registrationTokens }, function (err, response) {
var failed_tokens = registrationTokens.filter((token, i) => response[i].error != null);
console.log('These tokens are no longer ok:', failed_tokens);
});
Expand Down Expand Up @@ -167,6 +167,7 @@ This is due to [a restriction](https://firebase.google.com/docs/cloud-messaging/
|dryRun|Optional, JSON boolean|This parameter, when set to true, allows developers to test a request without actually sending a message.|
|data|Optional, JSON object|This parameter specifies the custom key-value pairs of the message's payload.|
|notification|Optional, JSON object|This parameter specifies the predefined, user-visible key-value pairs of the notification payload. See "Notification payload option table" below for more details.|
|fcm_options|Optional, JSON object|This parameter is used to pass FCM specific options as outlined (here)[https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#FcmOptions]|

## Notification usage

Expand Down

0 comments on commit 859625a

Please sign in to comment.