Inbox
The Inbox feature allows your application to provide users with an in-app message center, ensuring that notifications remain accessible even after they are dismissed from the system tray. By implementing an inbox, you can significantly increase user engagement, as messages will always be available directly within your app.
This module provides all the APIs necessary to retrieve, open, and manage inbox messages. To enable this functionality, run the following command:
dotnet add package Actito.Inbox
Before getting started with this module, ensure that the following steps have been completed:
- You have successfully completed the Getting Started guide
Overview
The standard implementation uses a device-level inbox, meaning each device maintains its own independent message list — regardless of the authenticated user. This design ensures that every device receives and stores messages consistently, even before a user logs in.
You should not use both the Actito.Inbox and Actito.UserInbox modules within the same application. Each module provides its own independent implementation of the inbox feature — Actito.Inbox manages messages at the device level, while Actito.UserInbox manages them at the user level. Using both simultaneously can cause synchronization issues, and unexpected behavior. Choose the module that best fits your use case and integrate only one inbox type per app.
If your application requires an inbox that persists across multiple devices for the same authenticated user, refer to the User Inbox documentation for implementation details.
Listening to Inbox changes
The inbox can be observed through the Actito Inbox API, allowing your UI to automatically reflect changes as messages arrive, are read, or removed.
Example — observing inbox items:
ActitoInbox.InboxUpdated += (sender, args) =>
{
// Update your UI with the new list of inbox items
};
Similarly, you can listen for updates to the number of unread messages:
ActitoInbox.InboxUpdated += (sender, args) =>
{
// Update your UI with the new list of inbox items
};
For synchronous access, you can retrieve the current state directly:
// Retrieve the list of inbox items
var items = ActitoInbox.Items;
// Retrieve the current unread badge count
var badge = ActitoInbox.Badge;
Opening Inbox items
Once you hold a reference to an inbox item, you can open it by invoking the following method:
ActitoInboxItem item;
var notification = await ActitoInbox.OpenAsync(item);
// Optional: Present the notification with Push UI.
#if ANDROID
ActitoPushUI.PresentNotification(notification, Platform.CurrentActivity!);
#elif IOS
ActitoPushUI.PresentNotification(notification, Platform.GetCurrentUIViewController()!);
#endif
Managing Inbox items
You can manage the inbox contents through a variety of operations provided by the SDK.
Marking messages a read
To mark a specific message as read:
ActitoInboxItem item;
await ActitoInbox.MarkAsReadAsync(item);
To mark all messages as read:
await ActitoInbox.MarkAllAsReadAsync();
Removing messages
To remove a single message from the inbox:
ActitoInboxItem item;
await ActitoInbox.RemoveAsync(item);
To clear all messages from the inbox:
await ActitoInbox.ClearAsync();