Using a custom messaging service for Android


The sdk allows customers to use their own custom messaging service instead of the SDK's FCM implementation.


1. Configure the custom messaging service

To set the custom messaging service as the SDK's messaging service, complete the following:

  1. Set the messagingService value of the SDK configuration to custom.
  2. Create a custom messaging service implementation.
  3. Add a file to mce/plugins assets folder with the following content:

{ "messagingService": "" } To create a custom messaging service implementation, the customer should implement the SDK's MessagingService interface.

Sample code:

import android.content.Context;


public class CustomMessagingService implements MessagingService {
public void initialize(Context context, MceSdkConfiguration mceSdkConfiguration)

{ // code that runs on sdk init }@Override
public boolean register(Context context)

{ // perform any service registration code here. return true if registration is possible or false otherwise return true; }@Override
public String getServiceName()

{ // define the name of the messaging service return "MyCustomService"; }}