linagora / Twake

Twake is a secure open source collaboration platform to improve organizational productivity.
https://twake.app
GNU Affero General Public License v3.0
1.79k stars 195 forks source link

Mobile implement notification acknowledgement #2489

Closed RomaricMourgues closed 1 year ago

RomaricMourgues commented 2 years ago

US: https://www.notion.so/linagora/Message-status-eb8ae81b14b14cef9dee939f2e14b487

We implemented on web the message status indicator like on Whatsapp (sent, delivered, read).

To mark a message as delivered, at least one of the notifications must have been delivered to a device.

Like on web, when such notification is received, you now need to call this endpoint:

POST /internal/services/notifications/v1/badges/:company_id/acknowledge
{
    "channel_id": "string",
    "workspace_id": "string",
    "thread_id": "string",
    "message_id": "string"
}

Doc here: https://github.com/linagora/Twake/issues/2464 And here: https://www.notion.so/linagora/API-Rest-Websockets-1f3f54f110b44743a102baf269f66ebd#7bdb0f9d7d3448c792eaedcffdbba0fd

This can be done with background execution called Isolates in flutter.

The FCM's document states:

When received [a push notification on flutter], an isolate is spawned (Android only, iOS/macOS does not require a separate isolate) allowing you to handle messages even when your application is not running.