1 min read

Message Inbox

The Message Inbox is a base implementation for third party inbox providers to reach their audience with inbox messages.

Without any customisation, Message Inbox - List screen looks like this:

Message Inbox - List screens
Message Inbox - List screens

Without any customisation, Message Inbox - Message Details screens looks like this:

Message Inbox - Message Details screens
Message Inbox - Message Details screens

Start using the Message Inbox SDK

To start using it, you need to:

  1. Add the feature module to your build.gradle
    implementation ("com.poqstudio:notifications.inbox:$VERSION_NAME")
  2. Include the specific third party Message Provider.
  3. Open the screen using InboxActivity. Message Inbox screen accepts messageId as a parameter, you can use InboxActivity.getStartIntent to get the appropriate Intent.
  4. Include the inbox content block in CMS.

The Message Inbox SDK is composed of these modules:

Koin modules

The Message Inbox SDK dependencies are injected using Koin. Message Ibox SDK provides the default dependencies definitions via these Koin modules:

Message Inbox SDK provides two new deep links:

  • ://inbox: it opens InboxActivity with InboxFragment on top.
  • ://inbox/message/{id}: it opens InboxActivity with InboxMessageDetailFragment on top.

Message Inbox Providers

The Message Inbox SDK does not contain a message provider it self, it rely on Third Party providers that will handle the messages storage and status.

Some platform integrations already include the Message Inbox Provider:

Currently, the message inbox implementation supports only one provider at a time, to support two or more providers simultaneously, check the topic below and provide an implementation that will mix the providers.

In case the project includes two or more of the integrations listed above, the provider inbox implementation not used should be removed, this can be done in the application class by removing the specific Inbox Modules, for example:

import com.poqstudio.emarsys.di.emarsysInboxModule
import com.poqstudio.platform.exponea.di.exponeaInboxModule
import com.poqstudio.platform.sfmc.di.sfmcInboxModule
class ClientApplication : PoqApplication(), KoinComponent {
override fun onCreate() {
extraKoinModules.addAll(
listOf(
networkModule,
customModule1,
customModule2,
),
)
if (isBloomreachMessageInboxProvider()) {
extraKoinModules.removeAll(
listOf(
emarsysInboxModule,
sfmcInboxModule,
),
)
} else if (isEmarsysMessageInboxProvider()) {
extraKoinModules.removeAll(
listOf(
exponeaInboxModule,
sfmcInboxModule,
),
)
} else if (isSFMCMessageInboxProvider()) {
extraKoinModules.removeAll(
listOf(
exponeaInboxModule,
emarsysInboxModule,
),
)
}
initSettings()
super.onCreate()
}
}

How to add a new message provider

To add a new message provider:

  1. Provide a custom provider implementation for the InboxMessageProvider interface.
  2. Provide a custom Koin module to inject the custom provider implementation:
    import org.koin.dsl.module
    val customModule = module {
    factory<InboxMessageProvider> { CustomInboxMessageProvider() }
    }