Interface UnbluNotificationApi


  • public interface UnbluNotificationApi
    This is a low level notification API.
    Make sure, whenever the Unblu firebase module is not used, to obtain an instance from this class.
    • Method Detail

      • onMessageReceived

        boolean onMessageReceived​(UnbluNotification notification,
                                  android.content.Context context)
        This method should be called for each new notification. It will internally check if the given notificationData are from an Unblu notification and will do nothing if it is not an Unblu notification.

        If it is an Unblu notification, the following behavior is applied:

        Handling of Unblu push notification
        App stateNew MessageRead MessageIncoming CallRevoke Call
        backgroundshow notificationremove notifications related to this threadshow notificationremove notifications related to this thread
        foreground Unblu UI closedshow notificationremove notifications related to this threadTrigger UiVisibilityRequestModelremove notifications related to this thread
        foreground Unblu UI openDoes nothingremove notifications related to this threadDoes nothingremove notifications related to this thread


        Parameters:
        notification - The Unblu notification
        context - The context of the application
        Returns:
        True if it was an Unblu notification and it was handled by Unblu.
      • setDeviceToken

        void setDeviceToken​(java.lang.String token)
        Set the push notification token to be used to send notifications.
        Parameters:
        token - then new push token
      • setNewMessagesNotificationChannelId

        void setNewMessagesNotificationChannelId​(android.content.Context context,
                                                 java.lang.String newMessageNotificationChannelId)
        Set and create the NotificationChannel for new messages
        Parameters:
        context - The context of the application
        newMessageNotificationChannelId - The new notification channel name
      • setIncomingCallsNotificationChannelId

        void setIncomingCallsNotificationChannelId​(android.content.Context context,
                                                   java.lang.String incomingCallsNotificationChannelId)
        Set and create the NotificationChannel for incoming calls
        Parameters:
        context - The context of the application
        incomingCallsNotificationChannelId - The new notification channel name
      • setMissedCallsNotificationChannelId

        void setMissedCallsNotificationChannelId​(android.content.Context context,
                                                 java.lang.String missedCallsNotificationChannelId)
        Set and create the NotificationChannel for missed calls
        Parameters:
        context - The context of the application
        missedCallsNotificationChannelId - The new notification channel name
      • getNewMessagesNotificationChannelId

        java.lang.String getNewMessagesNotificationChannelId()
        Returns:
        the current new messages NotificationChannel Id
      • getIncomingCallsNotificationChannelId

        java.lang.String getIncomingCallsNotificationChannelId()
        Returns:
        the current incoming calls NotificationChannel Id
      • getMissedCallsNotificationChannelId

        java.lang.String getMissedCallsNotificationChannelId()
        Returns:
        the current missed calls NotificationChannel Id
      • getDeviceToken

        java.lang.String getDeviceToken()
        Returns:
        the current device token
      • createNotificationApi

        static UnbluNotificationApi createNotificationApi()
        Retrieve a new instance of UnbluNotificationApi, make sure to use this if you are not using the Unblu Firebase module.
        Returns:
        a new UnbluNotificationApi instance