-
- All Implemented Interfaces:
-
io.getstream.android.push.permissions.NotificationPermissionHandler,io.getstream.video.android.core.notifications.NotificationHandler,io.getstream.video.android.core.notifications.StreamNotificationDispatcher,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,io.getstream.video.android.core.notifications.medianotifications.MediaNotificationHandler
@Deprecated(message = This class is deprecated. Use CompatibilityStreamNotificationHandler instead.) public class DefaultNotificationHandler implements NotificationHandler, NotificationPermissionHandler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classDefaultNotificationHandler.Companion
-
Field Summary
Fields Modifier and Type Field Description private final DefaultStreamIntentResolverintentResolverprivate final BooleanhideRingingNotificationInForegroundprivate final IntegernotificationIconRes
-
Constructor Summary
Constructors Constructor Description DefaultNotificationHandler(Application application, NotificationPermissionHandler notificationPermissionHandler, Boolean hideRingingNotificationInForeground, Integer notificationIconRes)
-
Method Summary
Modifier and Type Method Description final DefaultStreamIntentResolvergetIntentResolver()final BooleangetHideRingingNotificationInForeground()Set this to true if you want to make the ringing notifications as low-priority in case the application is in foreground. final IntegergetNotificationIconRes()The notification icon for call notifications. 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 UnitonMissedCall(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 NotificationgetMissedCallNotification(StreamCallId callId, String callDisplayName, Map<String, Object> payload)Customize the notification when you receive a push notification for Missed Call NotificationgetSettingUpCallNotification()Temporary notification. NotificationgetSettingUpCallNotification(String trigger, StreamCallId callId)NotificationonCallNotificationUpdate(Call call)Get subsequent updates to notifications. NotificationupdateOngoingCallNotification(Call call, String callDisplayName)Update the ongoing call notification. NotificationupdateOutgoingCallNotification(Call call, String callDisplayName)Update the ringing call notification. NotificationupdateIncomingCallNotification(Call call, String callDisplayName)Update the ringing call notification. NotificationDispatchergetStreamNotificationDispatcher()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. UnitcreateIncomingCallChannel(String channelId, Boolean showAsHighPriority)UnitonNotification(StreamCallId callId, String callDisplayName, Map<String, Object> payload)Customize the notification when you receive a push notification for general usage UnitonLiveCall(StreamCallId callId, String callDisplayName, Map<String, Object> payload)Customize the notification when you receive a push notification for Live Call 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 UnitcreateOnGoingChannel(String ongoingCallsChannelId)UnitgetNotificationUpdates(CoroutineScope coroutineScope, Call call, User localUser, Function1<Notification, Unit> onUpdate)Get subsequent updates to notifications. UnitmaybeCreateChannel(String channelId, Context context, Function1<NotificationChannel, Unit> configure)UnitshowNotificationCallNotification(PendingIntent notificationPendingIntent, String callDisplayName, Integer notificationId)UnitshowNotificationCallNotification(PendingIntent notificationPendingIntent, String callDisplayName, Integer notificationId, Map<String, Object> payload)UnitshowMissedCallNotification(PendingIntent notificationPendingIntent, String callDisplayName, Integer notificationId)UnitshowMissedCallNotification(PendingIntent notificationPendingIntent, String callDisplayName, Integer notificationId, Map<String, Object> payload)UnitshowLiveCallNotification(PendingIntent liveCallPendingIntent, String callDisplayName, Integer notificationId)UnitshowLiveCallNotification(PendingIntent liveCallPendingIntent, String callDisplayName, Integer notificationId, Map<String, Object> payload)NotificationgetNotification(Function1<NotificationCompat.Builder, Unit> builder)NotificationCompat.BuilderaddHangUpAction(NotificationCompat.Builder $self, PendingIntent hangUpIntent, String callDisplayName, Integer remoteParticipantCount)NotificationCompat.BuilderaddCallActions(NotificationCompat.Builder $self, PendingIntent acceptCallPendingIntent, PendingIntent rejectCallPendingIntent, String callDisplayName)NotificationCompat.ActiongetLeaveAction(PendingIntent intent)NotificationCompat.ActiongetAcceptAction(PendingIntent intent)NotificationCompat.ActiongetRejectAction(PendingIntent intent)BooleanisInForeground()StringgetChannelId()StringgetChannelName()StringgetChannelDescription()NotificationCompat.BuildercreateMinimalMediaStyleNotification(StreamCallId callId, MediaNotificationConfig mediaNotificationConfig, Integer remoteParticipantCount)MediaNotificationConfiggetMediaNotificationConfig()-
Methods inherited from class io.getstream.video.android.core.notifications.NotificationHandler
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
-
DefaultNotificationHandler
DefaultNotificationHandler(Application application, NotificationPermissionHandler notificationPermissionHandler, Boolean hideRingingNotificationInForeground, Integer notificationIconRes)
-
-
Method Detail
-
getIntentResolver
final DefaultStreamIntentResolver getIntentResolver()
-
getHideRingingNotificationInForeground
final Boolean getHideRingingNotificationInForeground()
Set this to true if you want to make the ringing notifications as low-priority in case the application is in foreground. This will prevent the notification from interrupting the user while he is in the app. In this case you need to make sure to handle this call state and display an incoming call screen.
-
getNotificationIconRes
final Integer getNotificationIconRes()
The notification icon for call notifications.
-
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
-
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
-
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
-
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
-
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)
-
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.
-
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.
-
updateIncomingCallNotification
Notification updateIncomingCallNotification(Call call, String callDisplayName)
Update the ringing call notification.
- Parameters:
call- The Stream call object.
-
getStreamNotificationDispatcher
NotificationDispatcher getStreamNotificationDispatcher()
-
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.
-
createIncomingCallChannel
Unit createIncomingCallChannel(String channelId, Boolean showAsHighPriority)
-
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
-
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
-
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
-
createOnGoingChannel
Unit createOnGoingChannel(String ongoingCallsChannelId)
-
getNotificationUpdates
Unit getNotificationUpdates(CoroutineScope coroutineScope, Call call, User localUser, Function1<Notification, Unit> onUpdate)
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:
coroutineScope- Coroutine scope used for the updates.call- The Stream call object.localUser- The local Stream user.onUpdate- Callback to be called when the notification is updated.
-
maybeCreateChannel
Unit maybeCreateChannel(String channelId, Context context, Function1<NotificationChannel, Unit> configure)
-
showNotificationCallNotification
@Deprecated(message = Use the one with payload: Map<String, Any?>, replaceWith = @ReplaceWith(imports = {}, expression = Use the one with payload: Map<String, Any?>), level = DeprecationLevel.WARNING) Unit showNotificationCallNotification(PendingIntent notificationPendingIntent, String callDisplayName, Integer notificationId)
-
showNotificationCallNotification
Unit showNotificationCallNotification(PendingIntent notificationPendingIntent, String callDisplayName, Integer notificationId, Map<String, Object> payload)
-
showMissedCallNotification
@Deprecated(message = Use the one with payload: Map<String, Any?>, replaceWith = @ReplaceWith(imports = {}, expression = Use the one with payload: Map<String, Any?>), level = DeprecationLevel.WARNING) Unit showMissedCallNotification(PendingIntent notificationPendingIntent, String callDisplayName, Integer notificationId)
-
showMissedCallNotification
Unit showMissedCallNotification(PendingIntent notificationPendingIntent, String callDisplayName, Integer notificationId, Map<String, Object> payload)
-
showLiveCallNotification
@Deprecated(message = Use the one with payload: Map<String, Any?>, replaceWith = @ReplaceWith(imports = {}, expression = Use the one with payload: Map<String, Any?>), level = DeprecationLevel.WARNING) Unit showLiveCallNotification(PendingIntent liveCallPendingIntent, String callDisplayName, Integer notificationId)
-
showLiveCallNotification
Unit showLiveCallNotification(PendingIntent liveCallPendingIntent, String callDisplayName, Integer notificationId, Map<String, Object> payload)
-
getNotification
Notification getNotification(Function1<NotificationCompat.Builder, Unit> builder)
-
addHangUpAction
NotificationCompat.Builder addHangUpAction(NotificationCompat.Builder $self, PendingIntent hangUpIntent, String callDisplayName, Integer remoteParticipantCount)
-
addCallActions
NotificationCompat.Builder addCallActions(NotificationCompat.Builder $self, PendingIntent acceptCallPendingIntent, PendingIntent rejectCallPendingIntent, String callDisplayName)
-
getLeaveAction
NotificationCompat.Action getLeaveAction(PendingIntent intent)
-
getAcceptAction
NotificationCompat.Action getAcceptAction(PendingIntent intent)
-
getRejectAction
NotificationCompat.Action getRejectAction(PendingIntent intent)
-
isInForeground
Boolean isInForeground()
-
getChannelId
String getChannelId()
-
getChannelName
String getChannelName()
-
getChannelDescription
String getChannelDescription()
-
createMinimalMediaStyleNotification
NotificationCompat.Builder createMinimalMediaStyleNotification(StreamCallId callId, MediaNotificationConfig mediaNotificationConfig, Integer remoteParticipantCount)
-
getMediaNotificationConfig
MediaNotificationConfig getMediaNotificationConfig()
-
-
-
-