Custom processing for Android inbox & inapp messages

3.8.2 Android SDK

In the Android 3.8.2 SDK there is an option to override the SDK processing of incoming Inbox & Inapp messages. A user should complete the following:

  1. Create an implementation of the co.acoustic.mobile.push.sdk.api.message.MessageProcessor interface that extends the relevant SDK message processor.

Inbox message example

public class CustomInboxProcessor extends co.acoustic.mobile.push.sdk.plugin.inbox.InboxMessageProcessor {
      @Override
      public ProcessReport<RichContent> process(Context context, List<RichContent>              messages) {
            // manipulate messages code here
            super.process(context, messages);
      }
}

Inapp message example

public class CustomInAppProcessor extends co.acoustic.mobile.push.sdk.plugin.inapp.InAppMessageProcessor {
      @Override
     public ProcessReport<InAppPayload> process(Context context, List<InAppPayload> messages) {
            // manipulate messages code here
            super.process(context, messages);
      }
}
  1. Set the implementation class as the SDK message processor for the relevant message type.

For inbox, in plugin-inbox.json

"message-processors": [{
"name": "messages",
"class": "<the message processor impl full class name>"
}]

For inapp, in plugin-inapp.json

"message-processors": [{
"name": "inAppMessages",
"class": "<the message processor impl full class name>"
}]