2

GCM provides a way to send dry run messages to test the request formats, as explain in reference https://developers.google.com/cloud-messaging/http-server-ref. How can the similar dry_run support be achieved with VAPID (FCM) standard?

1 Answers1

3

I know this is an old post, but I'll answer. Maybe it helps someone.

You can use DryRun to test in FCM too. Look:

// Send a message in the dry run mode.
var dryRun = true;
admin.messaging().send(message, dryRun)
  .then((response) => {
    // Response is a message ID string.
    console.log('Dry run successful:', response);
  })
  .catch((error) => {
    console.log('Error during dry run:', error);
  });

You need to pass a bool as second parameter of send() function.

Paschoali
  • 91
  • 1
  • 8