Embed the Message Center
Airship’s SDK provides a simple interface for managing the Message Center within your application.
This guide covers creating custom Message Center implementations for Unity applications.
Override Default Display Behavior
By default, the plugin shows the out-of-the-box Message Center UI. To provide your own UI, disable the default and handle the display request in the OnShowInbox event.
Airship.Shared.messageCenter.SetAutoLaunchDefaultMessageCenter(false);
Airship.Shared.OnShowInbox += (string messageId) => {
if (string.IsNullOrEmpty(messageId))
{
// Navigate to message center
}
else
{
// Navigate to specific message
}
};Custom Message Center Implementation
With the default UI disabled, build your own inbox using Fetch Messages and the inbox events, then use the following methods to display message content when a user makes a selection.
Overlay the message body for a specific message:
Airship.Shared.messageCenter.ShowMessageView("message-id");Overlay the Message Center regardless of whether auto-launch is enabled. Pass null to show the inbox, or a message ID to show a specific message:
Airship.Shared.messageCenter.ShowMessageCenter(null);Dismiss the out-of-the-box Message Center if it is displayed:
Airship.Shared.messageCenter.Dismiss();