Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Develop
Test
Publish
Monetize
Engage users
Device specifications
Resources
Skip to main content
This page describes how to integrate the A3L Messaging SDK into your project.

Extend the A3LMessagingService class

The A3LMessagingService class is part of the A3L Messaging SDK. You must extend from this class to allow your app to receive messages. The following table describes the methods you must override in your implementation.
MethodDescription
onMessageReceived()Called when a message is delivered to your app instance.
onNewToken()Called when a new device ID for the app instance is ready.
The following code shows an example implementation with a class named MyA3LMessagingService.

Update your app manifest

You must update your app’s AndroidManifest.xml file to receive messages. The following examples use MyA3LMessagingService as a placeholder for your implementation of the A3LMessagingService class.
  1. Declare your implementation of the A3LMessagingService class as a receiver. This allows you to handle REGISTRATION and MESSAGE intents.
  2. Add details about your implementation of A3LMessagingService as metadata. This allows proper initialization of A3L Messaging.

Retrieve the registration token

On initial startup of your app, the A3L Messaging library generates a registration token for the client app instance. This token is delivered in your overridden onNewToken() method of the A3LMessagingService class. To get the current registration token, call A3LMessaging.getToken(), as shown in the following example.

Optional - Create an escape hatch

If you have a special use case and want to create a custom method, you can create an escape hatch for that scenario. The A3LMessaging class provides you with an instance of an ADM object and a FirebaseMessaging object that you can make calls from.
  1. Use A3LMessaging.getCurrentPlatform() to get the current messaging solution as a String.
    • If FCM_PLATFORM is returned, use A3LMessaging.getFCMInstance() to get the instance.
    • If ADM_PLATFORM is returned, use A3LMessaging.getADMInstance().
  2. Now you can make calls directly with the FirebaseMessaging and ADM objects. See the following example.
  3. If you need to override methods which are unsupported by the A3LMessagingService, you can create your own custom class. To do this, inherit from the solution-specific API and override the method you need access to. For example, if your app needs access to the onDeletedMessages() method from FirebaseMessagingService, you could create a class like the one in the following example.
    You must also set up your app to listen for the events of this API. The setup required might vary based on the messaging solution and API.

A3L Messaging API reference

For details on the classes and methods contained in the A3L Messaging SDK, see the complete A3L Messaging API reference.

Next steps

See Test A3L Messaging.
Last modified on September 19, 2025