Buddy4all: Difference between revisions
From Salumentis
| Line 26: | Line 26: | ||
} | } | ||
</pre> | </pre> | ||
==== When new friendship request has been canceled ==== | |||
Channel: Websocket only | |||
Socket message: | |||
<pre> | |||
{ | |||
message: "friendship status changed", | |||
message_type: "api_friendship_status", | |||
status: "canceled",. | |||
friend_id: [:id of the inviting user:], | |||
open_requests: [:# of open friendship requests:], | |||
} | |||
</pre> | |||
==== When a friendship as been accepted ==== | ==== When a friendship as been accepted ==== | ||
| Line 35: | Line 52: | ||
<pre> | <pre> | ||
{ | { | ||
message: "Message | message: "friendship status changed", | ||
message_type: | message_type: "api_friendship_status", | ||
friend_id: [:id of the | status: "accepted",. | ||
friend_id: [:id of the invited user:], | |||
open_requests: [:# of open friendship requests:], | |||
} | |||
</pre> | |||
==== When a friendship request as been rejected ==== | |||
Sent when a friendship request has been rejected, a message is sent to the creator of the request | |||
Channel: Websocket only | |||
Message: | |||
<pre> | |||
{ | |||
message: "friendship status changed", | |||
message_type: "api_friendship_status", | |||
status: "rejected",. | |||
friend_id: [:id of the invited user:], | |||
open_requests: [:# of open friendship requests:], | |||
} | |||
</pre> | |||
==== When a friendship has been terminated by one of the users ==== | |||
Channel: Websocket only | |||
Message: | |||
<pre> | |||
{ | |||
message: "friendship status changed", | |||
message_type: "api_friendship_status", | |||
status: "terminated",. | |||
friend_id: [:id of the invited user:], | |||
open_requests: [:# of open friendship requests:], | open_requests: [:# of open friendship requests:], | ||
} | } | ||
</pre> | </pre> | ||
Revision as of 09:13, 29 September 2023
Introduction
User's Guide
Developers Guide
Notification messages
Notifications are sent by the backend via Websocket and/or Firebase push notifications. The following notification are sent:
Friendship endpoints
When new friendship request has been made
Channel: Websocket and Firebase
Socket message:
{
message: "friendship status changed",
message_type: "api_friendship_status",
status: "new_request",.
friend_id: [:id of the inviting user:],
open_requests: [:# of open friendship requests:],
}
When new friendship request has been canceled
Channel: Websocket only
Socket message:
{
message: "friendship status changed",
message_type: "api_friendship_status",
status: "canceled",.
friend_id: [:id of the inviting user:],
open_requests: [:# of open friendship requests:],
}
When a friendship as been accepted
Sent when a friendship request has been accepted, a message is sent to the creator of the request
Channel: Websocket only
Message:
{
message: "friendship status changed",
message_type: "api_friendship_status",
status: "accepted",.
friend_id: [:id of the invited user:],
open_requests: [:# of open friendship requests:],
}
When a friendship request as been rejected
Sent when a friendship request has been rejected, a message is sent to the creator of the request
Channel: Websocket only
Message:
{
message: "friendship status changed",
message_type: "api_friendship_status",
status: "rejected",.
friend_id: [:id of the invited user:],
open_requests: [:# of open friendship requests:],
}
When a friendship has been terminated by one of the users
Channel: Websocket only
Message:
{
message: "friendship status changed",
message_type: "api_friendship_status",
status: "terminated",.
friend_id: [:id of the invited user:],
open_requests: [:# of open friendship requests:],
}
