Class FlurryMessaging

java.lang.Object
com.flurry.android.marketing.messaging.FlurryMessaging

public final class FlurryMessaging extends Object
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 Details

    • showNotification

      public static void showNotification(android.content.Context context, FlurryMessage flurryMessage)
      A method to have Flurry show the notification
      Parameters:
      context - context
      flurryMessage - the notification
    • logNotificationReceived

      public static void logNotificationReceived(FlurryMessage flurryMessage)
      Log notification received event to flurry
      Parameters:
      flurryMessage - the notification
    • logNotificationClicked

      public static void logNotificationClicked(FlurryMessage flurryMessage)
      Log notification clicked/opened event to flurry
      Parameters:
      flurryMessage - the notification
    • logNotificationCancelled

      public static void logNotificationCancelled(FlurryMessage flurryMessage)
      Log notification cancelled event to flurry
      Parameters:
      flurryMessage - the notification
    • setToken

      public static void setToken(String token)
      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 if isFlurryMessage(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 intent
      flurryMessage - the message
    • getFlurryMessageFromIntent

      public static FlurryMessage getFlurryMessageFromIntent(android.content.Intent intent)
      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