StreamDefaultNotificationHandler

open class StreamDefaultNotificationHandler constructor(application: Application, notificationManager: NotificationManagerCompat = NotificationManagerCompat.from( application.applicationContext, ), notificationPermissionHandler: NotificationPermissionHandler = DefaultNotificationPermissionHandler.createDefaultNotificationPermissionHandler( application, ), intentResolver: StreamIntentResolver = DefaultStreamIntentResolver(application, DefaultNotificationIntentBundleResolver()), hideRingingNotificationInForeground: Boolean = (StreamVideo.instanceOrNull() as? StreamVideoClient)?.streamNotificationManager?.notificationConfig?.hideRingingNotificationInForeground == true, initialNotificationBuilderInterceptor: StreamNotificationBuilderInterceptors = StreamNotificationBuilderInterceptors(), updateNotificationBuilderInterceptor: StreamNotificationUpdateInterceptors = StreamNotificationUpdateInterceptors(), notificationChannels: StreamNotificationChannels = StreamNotificationChannels( incomingCallChannel = createChannelInfoFromResIds( application.applicationContext, R.string.stream_video_incoming_call_notification_channel_id, R.string.stream_video_incoming_call_notification_channel_title, R.string.stream_video_incoming_call_notification_channel_description, NotificationManager.IMPORTANCE_HIGH, ), ongoingCallChannel = createChannelInfoFromResIds( application.applicationContext, R.string.stream_video_ongoing_call_notification_channel_id, R.string.stream_video_ongoing_call_notification_channel_title, R.string.stream_video_ongoing_call_notification_channel_description, NotificationManager.IMPORTANCE_DEFAULT, ), outgoingCallChannel = createChannelInfoFromResIds( application.applicationContext, R.string.stream_video_outgoing_call_notification_channel_id, R.string.stream_video_outgoing_call_notification_channel_title, R.string.stream_video_outgoing_call_notification_channel_description, NotificationManager.IMPORTANCE_DEFAULT, ), missedCallChannel = createChannelInfoFromResIds( application.applicationContext, R.string.stream_video_missed_call_notification_channel_id, R.string.stream_video_missed_call_notification_channel_title, R.string.stream_video_missed_call_notification_channel_description, NotificationManager.IMPORTANCE_HIGH, ), missedCallLowImportanceChannel = createChannelInfoFromResIds( application.applicationContext, R.string.stream_video_missed_call_low_priority_notification_channel_id, R.string.stream_video_missed_call_notification_channel_title, R.string.stream_video_missed_call_low_priority_notification_channel_description, NotificationManager.IMPORTANCE_DEFAULT, ), incomingCallLowImportanceChannel = createChannelInfoFromResIds( application.applicationContext, R.string.stream_video_incoming_call_low_priority_notification_channel_id, R.string.stream_video_incoming_call_notification_channel_title, R.string.stream_video_incoming_call_low_priority_notification_channel_description, NotificationManager.IMPORTANCE_DEFAULT, ), ), mediaSessionCallback: MediaSessionCompat.Callback? = null, mediaSessionController: StreamMediaSessionController = DefaultStreamMediaSessionController( initialNotificationBuilderInterceptor, updateNotificationBuilderInterceptor, ), notificationDispatcher: NotificationDispatcher = DefaultNotificationDispatcher(notificationManager), permissionChecker: (context: Context, permission: String) -> Int = { context, permission -> ActivityCompat.checkSelfPermission(context, permission) }) : StreamNotificationHandler, StreamNotificationProvider, StreamNotificationUpdatesProvider, NotificationPermissionHandler

Default implementation of the StreamNotificationHandler interface.

Inheritors

Constructors

Link copied to clipboard
constructor(application: Application, notificationManager: NotificationManagerCompat = NotificationManagerCompat.from( application.applicationContext, ), notificationPermissionHandler: NotificationPermissionHandler = DefaultNotificationPermissionHandler.createDefaultNotificationPermissionHandler( application, ), intentResolver: StreamIntentResolver = DefaultStreamIntentResolver(application, DefaultNotificationIntentBundleResolver()), hideRingingNotificationInForeground: Boolean = (StreamVideo.instanceOrNull() as? StreamVideoClient)?.streamNotificationManager?.notificationConfig?.hideRingingNotificationInForeground == true, initialNotificationBuilderInterceptor: StreamNotificationBuilderInterceptors = StreamNotificationBuilderInterceptors(), updateNotificationBuilderInterceptor: StreamNotificationUpdateInterceptors = StreamNotificationUpdateInterceptors(), notificationChannels: StreamNotificationChannels = StreamNotificationChannels( incomingCallChannel = createChannelInfoFromResIds( application.applicationContext, R.string.stream_video_incoming_call_notification_channel_id, R.string.stream_video_incoming_call_notification_channel_title, R.string.stream_video_incoming_call_notification_channel_description, NotificationManager.IMPORTANCE_HIGH, ), ongoingCallChannel = createChannelInfoFromResIds( application.applicationContext, R.string.stream_video_ongoing_call_notification_channel_id, R.string.stream_video_ongoing_call_notification_channel_title, R.string.stream_video_ongoing_call_notification_channel_description, NotificationManager.IMPORTANCE_DEFAULT, ), outgoingCallChannel = createChannelInfoFromResIds( application.applicationContext, R.string.stream_video_outgoing_call_notification_channel_id, R.string.stream_video_outgoing_call_notification_channel_title, R.string.stream_video_outgoing_call_notification_channel_description, NotificationManager.IMPORTANCE_DEFAULT, ), missedCallChannel = createChannelInfoFromResIds( application.applicationContext, R.string.stream_video_missed_call_notification_channel_id, R.string.stream_video_missed_call_notification_channel_title, R.string.stream_video_missed_call_notification_channel_description, NotificationManager.IMPORTANCE_HIGH, ), missedCallLowImportanceChannel = createChannelInfoFromResIds( application.applicationContext, R.string.stream_video_missed_call_low_priority_notification_channel_id, R.string.stream_video_missed_call_notification_channel_title, R.string.stream_video_missed_call_low_priority_notification_channel_description, NotificationManager.IMPORTANCE_DEFAULT, ), incomingCallLowImportanceChannel = createChannelInfoFromResIds( application.applicationContext, R.string.stream_video_incoming_call_low_priority_notification_channel_id, R.string.stream_video_incoming_call_notification_channel_title, R.string.stream_video_incoming_call_low_priority_notification_channel_description, NotificationManager.IMPORTANCE_DEFAULT, ), ), mediaSessionCallback: MediaSessionCompat.Callback? = null, mediaSessionController: StreamMediaSessionController = DefaultStreamMediaSessionController( initialNotificationBuilderInterceptor, updateNotificationBuilderInterceptor, ), notificationDispatcher: NotificationDispatcher = DefaultNotificationDispatcher(notificationManager), permissionChecker: (context: Context, permission: String) -> Int = { context, permission -> ActivityCompat.checkSelfPermission(context, permission) })

Functions

Link copied to clipboard
open override fun getIncomingCallNotification(fullScreenPendingIntent: PendingIntent, acceptCallPendingIntent: PendingIntent, rejectCallPendingIntent: PendingIntent, callerName: String?, shouldHaveContentIntent: Boolean, payload: Map<String, Any?>): Notification?

Customize the notification when you receive a push notification for ringing call with type RingingState.Incoming

Link copied to clipboard
open override fun getMissedCallNotification(callId: StreamCallId, callDisplayName: String?, payload: Map<String, Any?>): Notification?

Customize the notification when you receive a push notification for Missed Call

Link copied to clipboard
open override fun getOngoingCallNotification(callId: StreamCallId, callDisplayName: String?, isOutgoingCall: Boolean, remoteParticipantCount: Int, payload: Map<String, Any?>): Notification?

Customize the notification when you receive a push notification for ringing call with type RingingState.Outgoing and RingingState.Active

Link copied to clipboard
open override fun getRingingCallNotification(ringingState: RingingState, callId: StreamCallId, callDisplayName: String?, shouldHaveContentIntent: Boolean, payload: Map<String, Any?>): Notification?

Customize the notification when you receive a push notification for ringing call

Link copied to clipboard

Temporary notification. Sometimes the system needs to show a notification while the call is not ready. This is the notification that will be shown.

Link copied to clipboard
open suspend override fun onCallNotificationUpdate(call: Call): Notification?

Get subsequent updates to notifications. Initially, notifications are posted by one of the other methods, and then this method can be used to re-post them with updated content.

Link copied to clipboard
open override fun onLiveCall(callId: StreamCallId, callDisplayName: String, payload: Map<String, Any?>)

Customize the notification when you receive a push notification for Live Call

Link copied to clipboard
open override fun onMissedCall(callId: StreamCallId, callDisplayName: String, payload: Map<String, Any?>)

Customize the notification when you receive a push notification for Missed Call

Link copied to clipboard
open override fun onNotification(callId: StreamCallId, callDisplayName: String, payload: Map<String, Any?>)

Customize the notification when you receive a push notification for general usage

Link copied to clipboard
open override fun onRingingCall(callId: StreamCallId, callDisplayName: String, payload: Map<String, Any?>)

Customize the notification when you receive a push notification for ringing call, which has further two types RingingState.Incoming and RingingState.Outgoing

Link copied to clipboard
open suspend override fun updateIncomingCallNotification(call: Call, callDisplayName: String): Notification?

Update the ringing call notification.

Link copied to clipboard
open suspend override fun updateOngoingCallNotification(call: Call, callDisplayName: String): Notification?

Update the ongoing call notification.

Link copied to clipboard
open suspend override fun updateOutgoingCallNotification(call: Call, callDisplayName: String?): Notification?

Update the ringing call notification.

Inherited functions

Link copied to clipboard
open fun getIncomingCallNotification(fullScreenPendingIntent: PendingIntent, acceptCallPendingIntent: PendingIntent, rejectCallPendingIntent: PendingIntent, callerName: String?, shouldHaveContentIntent: Boolean): Notification?

Customize the notification when you receive a push notification for ringing call with type RingingState.Incoming

Link copied to clipboard
open fun getMissedCallNotification(callId: StreamCallId, callDisplayName: String? = null): Notification?

Customize the notification when you receive a push notification for Missed Call

Link copied to clipboard
open fun getOngoingCallNotification(callId: StreamCallId, callDisplayName: String? = null, isOutgoingCall: Boolean = false, remoteParticipantCount: Int = 0): Notification?

Customize the notification when you receive a push notification for ringing call with type RingingState.Outgoing and RingingState.Active

Link copied to clipboard
open fun getRingingCallNotification(ringingState: RingingState, callId: StreamCallId, callDisplayName: String? = null, shouldHaveContentIntent: Boolean = true): Notification?

Customize the notification when you receive a push notification for ringing call

Link copied to clipboard
open fun onLiveCall(callId: StreamCallId, callDisplayName: String)

Customize the notification when you receive a push notification for Live Call

Link copied to clipboard
open fun onMissedCall(callId: StreamCallId, callDisplayName: String)

Customize the notification when you receive a push notification for Missed Call

Link copied to clipboard
open fun onNotification(callId: StreamCallId, callDisplayName: String)

Customize the notification when you receive a push notification for general usage

Link copied to clipboard
open override fun onPermissionDenied()
Link copied to clipboard
open override fun onPermissionGranted()
Link copied to clipboard
open override fun onPermissionRationale()
Link copied to clipboard
open override fun onPermissionRequested()
Link copied to clipboard
open fun onRingingCall(callId: StreamCallId, callDisplayName: String)

Customize the notification when you receive a push notification for ringing call, which has further two types RingingState.Incoming and RingingState.Outgoing