Handling for notifications created by the app

We have successfully implemented handling for push notifications using the APIs offered by UA Android SDK. Key components of the implementation include the NotificationProvider & NotificationListener which simplify the process greatly.

Problem

One of the actions (implemented using ActionsNotificationExtender) needs to perform a network call & post a notification - this notification is not based on push and falls outside the usual push notification flow. Is there a way to make this notification go through the SDK flow - have the NotificationProvider create the notification content & get NotificationListener to receive callbacks?

Didn't find what you were looking for?

New post

Comments

2 comments

  • We are not quite sure we fully understand the use case here. Are you attempting to create a Local Notification or something different?

    1
  • That's correct, we're looking to create a local notification. Here's a bit more context:

    - we receive a push notification that goes through NotificationProvider and posts a notification with an action that can 'mute' alerts for a given event

    - when this action is invoked, we need to display a local notification that can 'unmute' notifications for the associated event

    The way we have this setup at the moment is:

    - action to 'mute' event alerts is sent to a BroadcastReceiver that does a server call to mute alerts, and creates a notification with 'unmute' action

    - the action to 'unmute' alerts also triggers this BroadcastReceiver, makes a server call, and cancels the 'unmute' notification.

    Our concern is that these two flows have to be implemented separately, even though there's overlapping functionality. Is there currently a way for local notifications to go through the same flow as push notifications? 

    - to have them built through NotificationProvider

    - to have their actions invoke NotificationListener#onNotificationForegroundAction()/onNotificationBackgroundAction()

    0

Please sign in to leave a comment.