Package com.zendesk.connect
Class ConnectMessagingService
- java.lang.Object
-
- FirebaseMessagingService
-
- com.zendesk.connect.ConnectMessagingService
-
public class ConnectMessagingService extends FirebaseMessagingService
Handles incoming notifications from Firebase. The SDK will attempt to parse the message received into a
NotificationPayload
object which represents the data of a Connect notification. This service should be registered in the Android manifest of the host app.<service android:name="com.zendesk.connect.ConnectMessagingService"> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT"/> </intent-filter> </service>
By default the SDK will build and display notifications received from Connect but will not do anything for notifications received from other external sources. To handle any other pushes you should extend this class and implement the public methods as needed.
-
ConnectMessagingService.handleNonConnectNotification(RemoteMessage)
is called when a notification is received that didn't originate from Connect. Should be overridden to handle displaying your own push notifications. -
ConnectMessagingService.onNotificationReceived(NotificationPayload)
is called when a Connect notification is received, regardless of whether it is displayed or not. Should be overridden to handle custom data contained in the push payload. -
ConnectMessagingService.onNotificationDisplayed(NotificationPayload)
is called when a Connect notification has been displayed to the user. -
ConnectMessagingService.provideCustomNotification(NotificationPayload)
is used to construct aNotification
to display to the user when a Connect notification is received. Should be overridden to handle building theNotification
yourself.
-
-
-
Constructor Summary
Constructors Constructor and Description ConnectMessagingService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
handleNonConnectNotification(RemoteMessage message)
Called when a non-Connect notification is received that we will not handle ourselves.void
onMessageReceived(RemoteMessage message)
void
onNotificationDisplayed(NotificationPayload payload)
Called after a Connect notification is displayed.void
onNotificationReceived(NotificationPayload payload)
Called after a Connect notification is received regardless of whether they display or not.Notification
provideCustomNotification(NotificationPayload payload)
Build theNotification
to be displayed
-
-
-
Method Detail
-
onMessageReceived
public final void onMessageReceived(RemoteMessage message)
-
handleNonConnectNotification
public void handleNonConnectNotification(RemoteMessage message)
Called when a non-Connect notification is received that we will not handle ourselves. This method can be overridden to allow integrators to handle their own push notifications.- Parameters:
message
- theRemoteMessage
received from the push notification
-
onNotificationReceived
public void onNotificationReceived(NotificationPayload payload)
Called after a Connect notification is received regardless of whether they display or not. This method can be overridden to handle custom payload properties.- Parameters:
payload
- theNotificationPayload
created from the push received
-
onNotificationDisplayed
public void onNotificationDisplayed(NotificationPayload payload)
Called after a Connect notification is displayed.- Parameters:
payload
- theNotificationPayload
created from the push received
-
provideCustomNotification
public Notification provideCustomNotification(NotificationPayload payload)
Build theNotification
to be displayed- Parameters:
payload
- theNotificationPayload
parsed from the notification received- Returns:
- a constructed
Notification
-
-