Update your app manifest
To receive messages, you must update your AndroidManifest.xml file. When setting up your app with FCM, you likely extended theFirebaseMessagingService class and added your subclass as a service in your app’s manifest. With ADM, you must extend three ADM classes and add your subclasses as services in your manifest. For descriptions of these classes, see Implement registration and message handling. You must also add permissions and explicitly enable ADM in your manifest file. The following instructions provide the details to make these updates.
-
Open your AndroidManifest.xml file and add the Amazon namespace:
-
To declare the permissions necessary to support ADM, after the
manifestelement, add thepermissionanduses-permissionelements. -
Explicitly enable ADM and declare whether your app requires ADM (
android:required="true") or can work without ADM being present (android:required="false"). If you specifyandroid:required="false", your app must degrade gracefully if ADM is unavailable. In theapplicationnode of the manifest, add theuses-libraryelement. -
Declare a broadcast receiver to handle the
REGISTRATIONandRECEIVEintents that ADM sends. ADM requires that the receiver be defined in the AndroidManifest.xml file, rather than programmatically. Immediately afteruses-libraryadd the following elements. -
After updating your AndroidManifest.xml file, you can confirm that the changes are correct for ADM by calling
ADMManifest.checkManifestAuthoredProperly(). If you receive ajava.lang.NoClassDefFoundError: com.amazon.device.messaging.ADMerror, check your manifest to verify that you have added theuses-libraryelement in the location specified in step 3.






