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:
Without any customisation, Message Inbox - Message Details screens looks like this:
Start using the Message Inbox SDK
To start using it, you need to:
- Add the feature module to your
build.gradle
implementation ("com.poqstudio:notifications.inbox:$VERSION_NAME") - Include the specific third party Message Provider.
- Open the screen using
InboxActivity
. Message Inbox screen acceptsmessageId
as a parameter, you can useInboxActivity.getStartIntent
to get the appropriate Intent. - 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:
Deep links
Message Inbox SDK provides two new deep links:
://inbox
: it opensInboxActivity
withInboxFragment
on top.://inbox/message/{id}
: it opensInboxActivity
withInboxMessageDetailFragment
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.emarsysInboxModuleimport com.poqstudio.platform.exponea.di.exponeaInboxModuleimport 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:
- Provide a custom provider implementation for the InboxMessageProvider interface.
- Provide a custom Koin module to inject the custom provider implementation:
import org.koin.dsl.moduleval customModule = module {factory<InboxMessageProvider> { CustomInboxMessageProvider() }}