Notification Customization
Platform: Android
This section explains how to customize notifications, including setting a custom small icon for push notifications.
Configuration
To set up a custom notification icon, configure it in your PaylisherAndroidConfig setup:
val config =
PaylisherAndroidConfig(apiKey = PAYLISHER_API_KEY, host = PAYLISHER_HOST).apply {
...
setSmallNotificationIcon = R.drawable.custom_notification_icon // Set custom small icon
...
}
PaylisherAndroid.setup(this, config)
Explanation
smallIconResId: This parameter allows you to define a custom small icon for notifications.- If not provided, the default icon (
R.drawable.notification_small_icon) will be used. - Ensure that the icon is a transparent PNG or a monochrome vector drawable to avoid unwanted background colors.
Best Practices
- Use a white icon on a transparent background.
- Store the icon in
res/drawable. - Prefer vector drawables for scalability.