ICNotificationFactory

This class is responsible for creating local notifications for display on the device. By default, the SDK will only produce notifications for Push messages.

Customisations may be introduced by inheriting from this class and overriding onBuildNotification and getActionIconId.

📘

It is possible to completely replace the default notification generation by overriding createNotification instead of onBuildNotification. In this instance you are responsible for building the complete notification and will not get any of the pre-built interactive message functionality.

createNotification

This method is invoked whenever the SDK needs to generate a notification for an incoming message. Override this method to completely replace the notification generation process. To stop notifications from being displayed it is valid to return null from this method.

  Syntax: Notification createNotification(Context context, ICMessage message, int notificationId, Bitmap bigPicture)

  Parameters:

ParameterTypeDescription
contextContextRefer to Android Context.
messageICMessageThe message for which to create a notification.
notificationIdintThe id to assign to the notification.
bigPictureBitmapSpecifies a bitmap for big picture notifications.

  Return Value: Returns an Android notification.

createNotification

This method is invoked whenever the SDK needs to generate a notification for an incoming message. Override this method to completely replace the notification generation process. To stop notifications from being displayed it is valid to return null from this method.

  Syntax: Notification createNotification(Context context, ICMessage message, int notificationId, Bitmap bigPicture)

  Parameters:

ParameterTypeDescription
contextContextRefer to Android Context.
messageICMessageThe message for which to create a notification.
notificationIdintThe id to assign to the notification.
bigPictureBitmapSpecifies a bitmap for big picture notifications. May be null.
largeIconBitmapA bitmap to be used for the large icon property of the notification. May be null.

  Return Value:
 Returns an Android notification.

getActionIconId

Override this method to return a drawable resource id to be used for an interactive message action.

  Syntax: int getActionIconId(String action, String identifier, ICMessage message)

  Parameters:

ParameterTypeDescription
actionStringSpecifies the interactive notification action. See the Messaging API Reference for more details.
identifierStringSpecifies the interactive action identifier. See the Messaging API Reference for more details.
messageICMessageThe message for which a notification is being built.

  Return Value:
 The resource id for the icon.

onBuildNotification


This method is invoked at the end of the SDK notification build process and may be used to customize the standard notifications.

  Syntax: void onBuildNotification(Context context, NotificationCompat.Builder builder, ICMessage message, int notificationId)

  Parameters:

ParameterTypeDescription
contextContextA valid Android Context instance.
builderNotificationCompat.BuilderThe Android NotificationCompat.Builder instance. Used to introduce customization to the notification.
messageICMessageThe message for which a notification is being built.
notificationIdintegerThe unique id of the notification.