Receiving Messages

Use an always-on endpoint to receive messages from peers.

The Relay SDK allows your users to receive messages even when their device is offline. Postboxes created in the Relay receive messages via HTTP POST to a unique endpoint. The body of the POST request is stored in the postbox. No headers or encoding information is saved.

The endpoint associated with each postbox is accessible via the return value from createPostbox or listPostboxes and should be shared with the peer wishing to send messages to the user.

The peer must then POST a message to the endpoint and it will be stored in the postbox.

Note that the message payload will be stored as provided, without any encryption. Clients should ensure that their message is encrypted appropriately before POSTing.

Last updated