Skip to main content

Setting up Push

There are 3 different services, for sending push messages, supported by Parley:

  • FCM (Firebase Cloud Messaging)
  • Webhooks
  • OAuth webhooks

When registering a device (using the Subscribe device call), you'll need to supply the right pushType. Once a device is registered with for example pushType = 4, all push messages to this device will then go through the Custom Webhook push service.

FCM (Firebase Cloud Messaging)

pushType = 6
FCM is created/hosted by Google and is the easiest to setup, but doesn't provide much self control over the push systems.

Webhooks

info

Webhooks are messages send from the Parley systems to your own systems notifying you that something has happend (ex. a new message is available).

pushType = 4
Webhooks require an endpoint to be available on your server and might be a bit harder for inexperienced users, but it provides a lot of control over the push system.

OAuth webhooks

pushType = 5
OAuth webhooks are the same as normal webhooks, but add a security layer on top. You can find more information about OAuth here

Server Responses

For all types of Push, we expect your server to respond with a 200 HTTP status code.
If you server sends something other than 200, we will consider the message "failed" and we will send this message 2 more times.
After the message has failed 3 times, we will remove the pushToken from the device and stop sending push messages for it.

You should only respond with a non-200 status code if you failed to "save"(/log) the message in your internal system. Do not "process" the message before sending a response, so we can keep this communication as quick as possible.

Basic rule of thumb;

  1. Save or log the message
  2. Was this successful?
    Yes; Return 200 (you don't want to receive this message again)
    No; Return non-200 (you would like to receive this message again)