(Incoming) Publish message from mobile app

This event is sent to your server when a player sends a message from the mobile application.

WebSocket event

Event name: messages@new

⚠️ Response required / expires after 60 seconds

Event data received

KeyTypeDescription
custom_idstringUnique identifier from your services (1-64 characters)
cidstringUnique content-id generated by iPear
payloadIncomingMessagePayloadMessage payload

Expected WebSocket response

You need to emit an event with the following name and data:

Response event name: messages@new/state

Response object

KeyTypeExtraDescription
cidstring
required
Unique content-id generated by iPear
successboolean
required
Message is added to your database and sent to the recipient
recipient_onlineboolean
required
Tell us if the recipient is online. If he's not, we send a notification to the recipient

Important

Response object must respect every type rule. If any structure isn't respected, your request will be rejected for "bad-request".

Response example

My response will be:

{
  "cid": "5f8f3ad37363fffa11b33566404611c4",
  "success": true,
  "recipient_online": false
}

What's next?

Outgoing events

Powered by Doctave