Inbox SDK

Prev Next

Overview

The Inbox SDK in iOS provides a way to fetch and display in-app messages stored on the server. This ensures users can access important information at any time, even if they missed the original notifications.

Purpose:

  • Deliver a persistent inbox for in-app messages like promotions, reminders, and updates.

  • Allow users to access content conveniently, even after dismissing push notifications.

Benefits:

  • Enhance user engagement by providing on-demand access to critical messages.

  • Ensure important updates are visible to users over time.

Implementation Details

  1. Set up Inbox SDK Integration:

    • Integrate the SDK as per the iOS SDK integration documentation. Inbox SDK support begins with iOS SDK v5.0+.

  2. Fetch Inbox Messages: Use the following method to start fetching inbox messages:

    For Objective-C:

    [[AppoxeeInapp shared] fetchAPXInBoxMessages];

    For Swift:

    AppoxeeInapp.shared()?.fetchAPXInBoxMessages()
  3. Handle Inbox Messages: Implement delegate methods to process fetched messages:

    For Objective-C:

    - (void)didReceiveInBoxMessages:(NSArray *)messages {
        for (APXInBoxMessage *message in messages) {
            NSLog(@"Message Subject: %@", message.subject);
        }
    }

    For Swift:

    func didReceiveInBoxMessages(_ messages: [APXInBoxMessage]) {
        for message in messages {
            print("Message Subject: \(message.subject ?? "No Subject")")
        }
    }
  4. Inbox Message Properties:

    • Each message includes metadata such as:

      • subject: Title of the message.

      • summary: Short description or preview of the message.

      • status: Message status (READ, UNREAD, or DELETED). See examples below for more information.

      • sentDate: Timestamp when the message was sent.

      • expireDate: Timestamp when the message expires.

      • extras: Custom parameters for additional metadata.

  5. Display Inbox Messages:

    • Use a UITableView or UICollectionView to display the fetched messages in a user-friendly format.

Examples of inbox statuses:

  • An unmatched mobile user (starting status is AUTO ) sets a message as READ. It stays marked as READif the user closes and reopens the app, or even if they uninstall and reinstall the app; the final status is READ .

  • A matched mobile user sets a message as READ. It stays marked as read even if the user closes and reopens the app; the final status is READ .

  • A matched mobile user sets a message as READ. If the user uses the logout function of the SDK and then logs back in with the same account, all inbox messages return to the default UNREADstatus.

  • A matched mobile user sets a message as READ. If the user logs out of the SDK and then logs in with a different account, the messages will have the UNREADstatus in the second account.

  • A matched mobile user sets a message as READ. It stays marked as READeven if the user uninstalls and re-installs the app. However, if the user logs out and then in again with the same account, the status will be UNREAD .

Keep in mind:

  • Test inbox functionality with varying message counts and server conditions.

  • Use compelling and concise message content for better engagement.

  • Handle expired or deleted messages gracefully to avoid confusion.