displayNotification
Handles and displays a push notification using the TWS SDK.
This method processes notification payloads (typically from FCM or similar services) and displays a notification to the user using the provided details. The notification is only shown if the SDK recognizes the payload as a supported TWS notification (i.e., it includes the necessary fields and a supported type).
Typical usage is from your FirebaseMessagingService.onMessageReceived
, passing in the relevant notification data. You may customize the notification appearance via contentTitle
, contentText
, smallIcon
, etc. Optionally, you can pass a navigation back stack (historyIntents
) for proper navigation when the notification is opened.
Return
true
if the notification was handled and displayed by the SDK, false
otherwise.
Parameters
The context for displaying the notification (usually the application context).
The title to display in the notification.
The message/body to display in the notification.
The notification payload as a Map (typically from FCM's remoteMessage.data
), must include at least projectId
, snippetId
, and type
for SDK to recognize and handle notification.
The resource ID of the small icon to show in the notification. Defaults to TWS SDK's default icon.
Whether to dismiss the notification when tapped. Default is true
.
The notification priority (see NotificationCompat). Default is NotificationCompat.PRIORITY_HIGH.
An optional list of Intents representing previous navigation history to construct the back stack.