Notification icon configured for MobilePush on Android, yet it’s not displayed

androidmarketing-cloudmobilepush

We can't seem to get Marketing Cloud (MobilePush) to display the icon we've configured it to display on Android. As far as I can tell, we've followed the documentation correctly, but the system default notification icon is still displayed. Using our own custom push notification handling (for handling non-MobilePush push notifications) shows the correct icon, which is using the same drawable resource.

We're using version 8.0.4 of the SDK (com.salesforce.marketingcloud:marketingcloudsdk:8.0.4).

Here's how we've configured the SDK:

Configuring SFMCSdk (stripped for brevity):

val sdkModuleConfig = SFMCSdkModuleConfig.build {
  pushModuleConfig = MarketingCloudConfig.builder()
    .setNotificationCustomizationOptions(
      NotificationCustomizationOptions.create { context, notificationMessage ->
        NotificationManager.getDefaultNotificationBuilder(
          context,
          notificationMessage,
          NotificationManager.createDefaultNotificationChannel(context),
          R.drawable.ic_notification, // <-- this icon is not displayed in notifications
        )
          .setContentIntent(
            NotificationManager.redirectIntentForAnalytics(
              context,
              buildNotificationIntent(notificationMessage.url),
              notificationMessage,
              true, // dismiss after opening
            ),
          )
      },
  )
}

SFMCSdk.configure(application, sdkModuleConfig) {
  // handle initialization status
}

Receiving push notifications:

SFMCSdk.requestSdk { sdk ->
  sdk.mp { mp ->
    mp.pushMessageManager.handleMessage(remoteMessage)
  }
}

Any steps to guide us in the right direction would be appreciated! ☺

Best Answer

The only thing that can make the icon not display correctly is it being invalid with regards to Google's requirements. See Google's notification icon requirements. Also, search for Android Asset Studio. It's a great tool for creating all sorts of Android assets.

Related Topic