Fetching notifications directly from the SDK when the app is in foreground #813
Labels
A-Notifications
T-Enhancement
New features, changes in functionality, performance boosts, user-facing improvements
X-Needs-Rust
This issue needs a Rust SDK change. It must have a link to a Rust SDK issue
Since we are constantly receiving updates from the Sliding Sync Response, which sometimes might be faster than APNS to notify that a room has received a new message, we can actually also send notifications locally if we are able to intercept notifications events directly from the SDK.
We should expose a notification handler in FFI that gives us at least the basic info of the notification for a given Client, like the room id and the event id, and use these info to send a local notification that behaves like a remote one.
Then we need to implement a mechanism that serves the first notification that is received (the one from the SDK or the one from APNS) without duplications.
For example we could store an hash of the notification event id, room id and user id, and every time a notification arrive check if that hash is already stored, if it is we discard the notification, otherwise we display it and save that hash.
Of course this system will only work in foreground, when the app is fully in background we will only rely on APNS.
The text was updated successfully, but these errors were encountered: