Class FlurryMessaging
java.lang.Object
com.flurry.android.marketing.messaging.FlurryMessaging
This class is the entry point to Flurry's marketing suite. There are two ways to incorporate
the notification suite in your app.
1. Auto integration - Flurry handles everything for you! We'll receive the notification, convert it to
a FlurryMessage, show the notification, handle the notification click, handle the dismissed notification,
and handle all the Flurry logging associated with it. Want some customized functionality? You
have the option of passing us a listener to handle any of these steps yourself
2. Manual integration - You handle the notification receivers and log events
(notification received, notification opened, notification cancelled) to Flurry.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addFlurryMessageToIntentExtras
(android.content.Intent intent, FlurryMessage flurryMessage) Use this helper method to add the FlurryMessage to the intent extrasstatic FlurryMessage
convertFcmMessageToFlurryMessage
(com.google.firebase.messaging.RemoteMessage remoteMessage) Convert an FCM notification into a Flurry one.static FlurryMessage
getFlurryMessageFromIntent
(android.content.Intent intent) Use this helper method to retrieve the FlurryMessage to the intent extrasstatic boolean
This method can be used to determine if the app is currently in foreground.static boolean
isFlurryMessage
(com.google.firebase.messaging.RemoteMessage remoteMessage) Determine if a FCM notification is a Flurry notificationstatic void
logNotificationCancelled
(FlurryMessage flurryMessage) Log notification cancelled event to flurrystatic void
logNotificationClicked
(FlurryMessage flurryMessage) Log notification clicked/opened event to flurrystatic void
logNotificationReceived
(FlurryMessage flurryMessage) Log notification received event to flurrystatic void
Pass flurry the user's push notification tokenstatic void
showNotification
(android.content.Context context, FlurryMessage flurryMessage) A method to have Flurry show the notification
-
Method Details
-
showNotification
A method to have Flurry show the notification- Parameters:
context
- contextflurryMessage
- the notification
-
logNotificationReceived
Log notification received event to flurry- Parameters:
flurryMessage
- the notification
-
logNotificationClicked
Log notification clicked/opened event to flurry- Parameters:
flurryMessage
- the notification
-
logNotificationCancelled
Log notification cancelled event to flurry- Parameters:
flurryMessage
- the notification
-
setToken
Pass flurry the user's push notification token- Parameters:
token
- the token
-
isFlurryMessage
public static boolean isFlurryMessage(com.google.firebase.messaging.RemoteMessage remoteMessage) Determine if a FCM notification is a Flurry notification- Parameters:
remoteMessage
- the received FCM notification- Returns:
- true if it is a Flurry push, false otherwise
-
convertFcmMessageToFlurryMessage
public static FlurryMessage convertFcmMessageToFlurryMessage(com.google.firebase.messaging.RemoteMessage remoteMessage) Convert an FCM notification into a Flurry one. Note: this will return null ifisFlurryMessage(RemoteMessage)
returns false.- Parameters:
remoteMessage
- the received FCM notification- Returns:
- A FlurryMessage is it is a Flurry notification, null otherwise
-
addFlurryMessageToIntentExtras
public static void addFlurryMessageToIntentExtras(android.content.Intent intent, FlurryMessage flurryMessage) Use this helper method to add the FlurryMessage to the intent extras- Parameters:
intent
- the intentflurryMessage
- the message
-
getFlurryMessageFromIntent
Use this helper method to retrieve the FlurryMessage to the intent extras- Parameters:
intent
- the intent- Returns:
- the flurry message stored in the intent extras
-
isAppInForeground
public static boolean isAppInForeground()This method can be used to determine if the app is currently in foreground. It can be used when integrating with the Flurry Marketing suite as Flurry will not show notifications if the app is in foreground. If the app is in foreground, you should handle the notification yourself.- Returns:
- true if app is in foreground, false otherwise
-