-
- All Implemented Interfaces:
-
io.getstream.android.push.permissions.NotificationPermissionHandler,io.getstream.video.android.core.notifications.handlers.StreamNotificationHandler,io.getstream.video.android.core.notifications.handlers.StreamNotificationHandlerWithPayload,io.getstream.video.android.core.notifications.handlers.StreamNotificationProvider,io.getstream.video.android.core.notifications.handlers.StreamNotificationProviderWithPayload,io.getstream.video.android.core.notifications.handlers.StreamNotificationUpdatesProvider,io.getstream.video.android.core.notifications.handlers.StreamSettingUpCallNotificationProvider
public class StreamDefaultNotificationHandler implements StreamNotificationHandler, StreamNotificationProvider, StreamNotificationUpdatesProvider, NotificationPermissionHandler
Default implementation of the StreamNotificationHandler interface.
-
-
Constructor Summary
Constructors Constructor Description StreamDefaultNotificationHandler(Application application, NotificationManagerCompat notificationManager, NotificationPermissionHandler notificationPermissionHandler, StreamIntentResolver intentResolver, Boolean hideRingingNotificationInForeground, StreamNotificationBuilderInterceptors initialNotificationBuilderInterceptor, StreamNotificationUpdateInterceptors updateNotificationBuilderInterceptor, StreamNotificationChannels notificationChannels, MediaSessionCompat.Callback mediaSessionCallback, StreamMediaSessionController mediaSessionController, NotificationDispatcher notificationDispatcher, Function2<Context, String, Integer> permissionChecker)
-
Method Summary
Modifier and Type Method Description UnitonRingingCall(StreamCallId callId, String callDisplayName, Map<String, Object> payload)Customize the notification when you receive a push notification for ringing call, which has further two types RingingState.Incoming and RingingState.Outgoing UnitonLiveCall(StreamCallId callId, String callDisplayName, Map<String, Object> payload)Customize the notification when you receive a push notification for Live Call UnitonMissedCall(StreamCallId callId, String callDisplayName, Map<String, Object> payload)Customize the notification when you receive a push notification for Missed Call UnitonNotification(StreamCallId callId, String callDisplayName, Map<String, Object> payload)Customize the notification when you receive a push notification for general usage NotificationgetMissedCallNotification(StreamCallId callId, String callDisplayName, Map<String, Object> payload)Customize the notification when you receive a push notification for Missed Call NotificationgetRingingCallNotification(RingingState ringingState, StreamCallId callId, String callDisplayName, Boolean shouldHaveContentIntent, Map<String, Object> payload)Customize the notification when you receive a push notification for ringing call NotificationgetIncomingCallNotification(PendingIntent fullScreenPendingIntent, PendingIntent acceptCallPendingIntent, PendingIntent rejectCallPendingIntent, String callerName, Boolean shouldHaveContentIntent, Map<String, Object> payload)Customize the notification when you receive a push notification for ringing call with type RingingState.IncomingThis method is invoked only when the incoming ringtone owner is IncomingRingtoneOwner.Legacy. NotificationgetNotificationOwnedIncomingCallNotification(StreamCallId streamCallId, RingingState.Incoming ringingState, PendingIntent fullScreenPendingIntent, PendingIntent contentPendingIntent, PendingIntent acceptCallPendingIntent, PendingIntent rejectCallPendingIntent, String callerName, Boolean shouldHaveContentIntent, Map<String, Object> payload)Creates an incoming-call notification when the notification owns ringtone playback. NotificationgetSettingUpCallNotification()Temporary notification. NotificationgetSettingUpCallNotification(String trigger, StreamCallId callId)NotificationgetOngoingCallNotification(StreamCallId callId, String callDisplayName, Boolean isOutgoingCall, Integer remoteParticipantCount, Map<String, Object> payload)Customize the notification when you receive a push notification for ringing call with type RingingState.Outgoing and RingingState.Active NotificationonCallNotificationUpdate(Call call)Get subsequent updates to notifications. NotificationupdateIncomingCallNotification(Call call, String callDisplayName)Update the ringing call notification. NotificationupdateOngoingCallNotification(Call call, String callDisplayName)Update the ongoing call notification. NotificationupdateOutgoingCallNotification(Call call, String callDisplayName)Update the ringing call notification. -
Methods inherited from class io.getstream.video.android.core.notifications.handlers.StreamDefaultNotificationHandler
getIncomingCallNotification, getMissedCallNotification, getOngoingCallNotification, getRingingCallNotification, onLiveCall, onMissedCall, onNotification, onPermissionDenied, onPermissionGranted, onPermissionRationale, onPermissionRequested, onRingingCall -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
StreamDefaultNotificationHandler
StreamDefaultNotificationHandler(Application application, NotificationManagerCompat notificationManager, NotificationPermissionHandler notificationPermissionHandler, StreamIntentResolver intentResolver, Boolean hideRingingNotificationInForeground, StreamNotificationBuilderInterceptors initialNotificationBuilderInterceptor, StreamNotificationUpdateInterceptors updateNotificationBuilderInterceptor, StreamNotificationChannels notificationChannels, MediaSessionCompat.Callback mediaSessionCallback, StreamMediaSessionController mediaSessionController, NotificationDispatcher notificationDispatcher, Function2<Context, String, Integer> permissionChecker)
-
-
Method Detail
-
onRingingCall
Unit onRingingCall(StreamCallId callId, String callDisplayName, Map<String, Object> payload)
Customize the notification when you receive a push notification for ringing call, which has further two types RingingState.Incoming and RingingState.Outgoing
- Parameters:
callId- An instance of StreamCallId representing the call identifiercallDisplayName- The name of the caller to display in the notification
-
onLiveCall
Unit onLiveCall(StreamCallId callId, String callDisplayName, Map<String, Object> payload)
Customize the notification when you receive a push notification for Live Call
- Parameters:
callId- An instance of StreamCallId representing the call identifiercallDisplayName- The name of the caller to display in the notification
-
onMissedCall
Unit onMissedCall(StreamCallId callId, String callDisplayName, Map<String, Object> payload)
Customize the notification when you receive a push notification for Missed Call
- Parameters:
callId- An instance of StreamCallId representing the call identifiercallDisplayName- The name of the caller to display in the notification
-
onNotification
Unit onNotification(StreamCallId callId, String callDisplayName, Map<String, Object> payload)
Customize the notification when you receive a push notification for general usage
- Parameters:
callId- An instance of StreamCallId representing the call identifiercallDisplayName- The name of the caller to display in the notification
-
getMissedCallNotification
Notification getMissedCallNotification(StreamCallId callId, String callDisplayName, Map<String, Object> payload)
Customize the notification when you receive a push notification for Missed Call
- Parameters:
callId- An instance of StreamCallId representing the call identifiercallDisplayName- The name of the caller to display in the notification
-
getRingingCallNotification
Notification getRingingCallNotification(RingingState ringingState, StreamCallId callId, String callDisplayName, Boolean shouldHaveContentIntent, Map<String, Object> payload)
Customize the notification when you receive a push notification for ringing call
- Parameters:
ringingState- The current state of ringing call, represented by RingingStatecallId- An instance of StreamCallId representing the call identifiercallDisplayName- The name of the caller to display in the notificationshouldHaveContentIntent- If set to true then it will launch a screen when the user will click on the notification
-
getIncomingCallNotification
Notification getIncomingCallNotification(PendingIntent fullScreenPendingIntent, PendingIntent acceptCallPendingIntent, PendingIntent rejectCallPendingIntent, String callerName, Boolean shouldHaveContentIntent, Map<String, Object> payload)
Customize the notification when you receive a push notification for ringing call with type RingingState.Incoming
This method is invoked only when the incoming ringtone owner is IncomingRingtoneOwner.Legacy. When the incoming ringtone owner is IncomingRingtoneOwner.Notification, StreamDefaultNotificationHandler.getNotificationOwnedIncomingCallNotification is invoked instead.
- Parameters:
fullScreenPendingIntent- A high-priority intent that launches an activity in full-screen mode, bypassing the lock screen.acceptCallPendingIntent- The intent triggered when accepting the call from the notification.rejectCallPendingIntent- The intent triggered when rejecting the call from the notification.callerName- The name of the caller to display in the notificationshouldHaveContentIntent- If true, clicking the notification triggers fullScreenPendingIntent.
-
getNotificationOwnedIncomingCallNotification
Notification getNotificationOwnedIncomingCallNotification(StreamCallId streamCallId, RingingState.Incoming ringingState, PendingIntent fullScreenPendingIntent, PendingIntent contentPendingIntent, PendingIntent acceptCallPendingIntent, PendingIntent rejectCallPendingIntent, String callerName, Boolean shouldHaveContentIntent, Map<String, Object> payload)
Creates an incoming-call notification when the notification owns ringtone playback.
Override this method to customize notification-owned incoming-call notifications. The default implementation configures the ringing channel, looping ringtone flags, separate content and full-screen intents, and accept and reject actions. Replacing those properties may prevent the incoming ringtone or full-screen presentation from working.
Returning
nullsuppresses both the incoming-call notification and its ringtone.- Parameters:
streamCallId- The incoming call identifier.ringingState- The current incoming ringing state.fullScreenPendingIntent- Opens the incoming-call screen without dismissing the notification.contentPendingIntent- Opens the incoming-call screen after a user taps the notification.acceptCallPendingIntent- Accepts the incoming call.rejectCallPendingIntent- Rejects the incoming call.callerName- The caller name displayed in the notification.shouldHaveContentIntent- Whether tapping the notification should open the call screen.payload- The payload associated with the incoming-call notification.
-
getSettingUpCallNotification
@Deprecated(message = Use StreamSettingUpCallNotificationProvider.getSettingUpCallNotification(trigger,callId), replaceWith = @ReplaceWith(imports = {}, expression = StreamSettingUpCallNotificationProvider.getSettingUpCallNotification(trigger,callId)), level = DeprecationLevel.WARNING) Notification getSettingUpCallNotification()
Temporary notification. Sometimes the system needs to show a notification while the call is not ready. This is the notification that will be shown.
-
getSettingUpCallNotification
Notification getSettingUpCallNotification(String trigger, StreamCallId callId)
-
getOngoingCallNotification
Notification getOngoingCallNotification(StreamCallId callId, String callDisplayName, Boolean isOutgoingCall, Integer remoteParticipantCount, Map<String, Object> payload)
Customize the notification when you receive a push notification for ringing call with type RingingState.Outgoing and RingingState.Active
- Parameters:
callId- An instance of StreamCallId representing the call identifiercallDisplayName- The name of the caller to display in the notificationisOutgoingCall- True if the call is outgoing RingingState.Outgoing, false if it is an active call RingingState.Active.remoteParticipantCount- Count of remote participant
-
onCallNotificationUpdate
Notification onCallNotificationUpdate(Call call)
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.
- Parameters:
call- The Stream call object.
-
updateIncomingCallNotification
Notification updateIncomingCallNotification(Call call, String callDisplayName)
Update the ringing call notification.
- Parameters:
call- The Stream call object.
-
updateOngoingCallNotification
Notification updateOngoingCallNotification(Call call, String callDisplayName)
Update the ongoing call notification.
- Parameters:
call- The Stream call object.
-
updateOutgoingCallNotification
Notification updateOutgoingCallNotification(Call call, String callDisplayName)
Update the ringing call notification.
- Parameters:
call- The Stream call object.
-
-
-
-