Inbox SDK

Prev Next

Overview

The Inbox SDK in Android enables developers to fetch and manage in-app messages stored on the server. This allows users to access messages like promotions, updates, or notifications at their convenience, even if they missed them as push notifications.

Use Case

  1. Purpose:

    • Provide users with a persistent inbox for messages like promotions, reminders, and updates.

    • Allow users to access important information even after push notifications are dismissed.

  2. Benefits:

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

    • Increase visibility for time-sensitive or critical messages.

Implementation Details

  1. Setup Inbox SDK Integration:

    • Ensure your project integrates the required SDK version (Inbox SDK is available for Android SDK v5.0+).

  2. Fetch Inbox Messages:

    • Use the following method to retrieve messages:

      Appoxee.instance().fetchInboxMessages(this);
  3. Handle Inbox Messages:

    • Implement callbacks to process received inbox messages:

      InAppInboxCallback callback = new InAppInboxCallback();
      callback.addInAppInboxMessagesReceivedCallback(new InAppInboxCallback.onInAppInboxMessagesReceived() {
          @Override
          public void onInAppInboxMessages(List<APXInboxMessage> messages) {
              // Process the list of inbox messages
              runOnUiThread(() -> {
                  // Update UI if necessary
              });
          }
      
          @Override
          public void onInAppInboxMessage(APXInboxMessage message) {
              // Process a single inbox message
              runOnUiThread(() -> {
                  // Display message in UI
              });
          }
      });
  4. Inbox Message Properties:

    • Inbox messages include metadata such as:

      • Subject

      • Summary

      • Status (READ, UNREAD, DELETED)

      • Sent date and expiration date

      • Rich content (e.g., HTML)

  5. Display Inbox Messages:

    • Populate the retrieved messages in a RecyclerView or similar UI component for the user to browse.

Keep in mind:

  • Test inbox message retrieval and display across devices and network conditions.

  • Use lightweight, clear, and engaging message content for a better user experience.

  • Messages persist on the server until explicitly deleted or expired.