In the preceding section, we discussed the configuration for utilizing the default notification center for displaying App Inbox messages.
For developers interested in implementing a custom View Controller for the App Inbox, the Castled SDK offers methods that facilitate the retrieval of messages for display. Additionally, the SDK provides essential methods for managing key lifecycle events.
// Fetching the unread message count directlyCastledInbox.sharedInstance.getInboxUnreadCount()// Listening to unread message count changes using a callbackCastledInbox.sharedInstance.observeUnreadCountChanges(listener:{ unreadCount inprint("Inbox unread count is \(unreadCount)")})// Retrieving all inbox itemsCastledInbox.sharedInstance.getInboxItems(completion:{ result inprint("Inbox items are \(result)")})// Logging read inbox itemsCastledInbox.sharedInstance.logInboxItemsRead(inboxItems)// Deleting a specific inbox itemCastledInbox.sharedInstance.deleteInboxItem(inboxItem)// Logging a click on an inbox itemCastledInbox.sharedInstance.logInboxItemClicked(inboxItem, buttonTitle:"title")