setMessageHandling

fun setMessageHandling(imageFailureHandler: MindboxImageFailureHandler = PushNotificationManager.messageHandler.imageFailureHandler, imageLoader: MindboxImageLoader = PushNotificationManager.messageHandler.imageLoader)

Allows you to specify additional components for message handling when calling the handleRemoteMessage function.

Standard image failure handling strategies:

  • applyDefaultStrategy (Used by default)

  • applyDefaultAndRetryStrategy

  • retryOrCancelStrategy

  • retryOrDefaultStrategy

  • cancellationStrategy See MindboxImageFailureHandler for more information.

Example:

class App : Application {

override fun onCreate() {
    ...
    val defaultImage = ContextCompat.getDrawable(this, R.drawable.ic_placeholder)?.toBitmap()
    Mindbox.setMessageHandling(
        imageLoader = MindboxImageLoader.default(),
        imageFailureHandler = MindboxImageFailureHandler.applyDefaultAndRetryStrategy(
            maxAttempts = 5,
            delay = 3_000,
            defaultImage = defaultImage,
        )
    )
    ...
}

}

See also