iOS App Inbox API

To start using the App Inbox feature, first make sure you have followed the integration guide.

The App Inbox is a great feature to keep all the messages in one place, allowing users to read messages even after they dismissed a notification. Your application is in charge of managing and displaying the messages.

An App Inbox message is a simple class proxy that only exposes the required information like the title, content, and the message read status. An App Inbox message can be actionable, meaning it can perform an action when selected, like opening a deep link or display an image. Executing a message action will mark the message as read.

The App Inbox provides a simple API for accessing the messages, removing them or change their status. For example, calling the getUnreadMessageCount: can be used to display a badge with the number of messages that require the users's attention.

To display the App Inbox messages, you could for example use a UITableViewController with a basic cell showing the title and subtitle. Set the text font weight to bold when unread. When user selects a row that is actionable, just call the [inbox executeMessage:message completion:nil]. The App Inbox can also notify the application that a message was added, read or expired by using a delegate.

note

The sample application available on Github here shows a simple UITableViewController implementation.

Handling App Inbox Events

You can set your view controller as an OpenBackAppInboxDelegate delegate or subscribe to the default notification center to receive events sent by the App Inbox when a message is added to the inbox, read (from notification), or has expired.

Example:

@interface AppInboxViewController () <UITableViewDelegate, UITableViewDataSource, OpenBackAppInboxDelegate>
@end
@implementation AppInboxViewController
- (void)viewDidLoad {
[super viewDidLoad];
[OpenBack setAppInboxDelegate:self];
...
}
#pragma mark - Inbox Delegate
- (void)appInboxMessageRead:(OpenBackAppInboxMessage *)inboxMessage {
// Handle read message
}
- (void)appInboxMessageAdded:(OpenBackAppInboxMessage *)inboxMessage {
// Handle added message
}
- (void)appInboxMessageExpired:(OpenBackAppInboxMessage *)inboxMessage {
// Handle expired message
}
- (void)appInboxMessageUpdated:(OpenBackAppInboxMessage *)inboxMessage {
// Handle updated message
}
@end