Configuring your MoEngage Account
- Ensure you have configured the Firebase application.
- Configure FCM
- Ensure you have the FCM server key.
- Ensure you add the FCM Server Key in the Dashboard --> Settings --> Channel --> Push --> Mobile Push --> Android.
Ensure you add the keys in both the Test and Live environment.
- Ensure that you have added the Firebase Messaging dependency in your application's build.gradle file.
Adding metadata for push notification
Metadata regarding the notification is required to show push notifications where the small icon and large icon drawable are mandatory.
For more information about API reference for all the possible options, refer to NotificationConfig.
Use the configureNotificationMetaData() to transfer the configuration to the SDK.
val moEngage = MoEngage.Builder(this, "XXXXXXXX") .configureNotificationMetaData(NotificationConfig(R.drawable.small_icon, R.drawable.large_icon)) .build() MoEngage.initialiseDefaultInstance(moEngage)
MoEngage moEngage = new MoEngage.Builder(this, "XXXXXXXXXX") .configureNotificationMetaData(new NotificationConfig(R.drawable.small_icon, R.drawable.large_icon)) .build(); MoEngage.initialiseDefaultInstance(moEngage);
Ensure that the SDK is initialized with the metadata in the onCreate() of the Application class for push notifications to work.
Notification Small Icon Guidelines
Notification small icon should be flat, pictured face on, and must be white on a transparent background.