Class FlurryAgent.Builder

java.lang.Object
com.flurry.android.FlurryAgent.Builder
Enclosing class:
FlurryAgent

public static class FlurryAgent.Builder extends Object
Builder Pattern class for FlurryAgent.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • withListener

      public FlurryAgent.Builder withListener(@NonNull FlurryAgentListener listener)
      Sets the listener. The listener is an interface which can be implemented to receive notification of various events associated with session.
      Parameters:
      listener - Your implementation of the Flurry agent listener.
      Returns:
      The Builder instance.
    • withLogEnabled

      public FlurryAgent.Builder withLogEnabled(boolean enableLog)
      True to enable or false to disable the internal logging for the Flurry SDK.
      Parameters:
      enableLog - true to enable logging, false to disable it.
      Returns:
      The Builder instance.
    • withLogLevel

      public FlurryAgent.Builder withLogLevel(int logLevel)
      Set the log level of the internal Flurry SDK logging.
      Parameters:
      logLevel - The level to set it to.
      Returns:
      The Builder instance.
    • withContinueSessionMillis

      public FlurryAgent.Builder withContinueSessionMillis(long sessionMillis)
      Set the timeout for expiring a Flurry session. This must be called before #onStartSession to have an effect. ode FlurryAgent.setContinueSessionMillis(60 * 1000); // Set session timeout to 60 seconds FlurryAgent.onStartSession(this, kApiKey);
      Parameters:
      sessionMillis - The time in milliseconds to set the session timeout to. Minimum value of 5000.
      Returns:
      The Builder instance.
      Since:
      1.0 The default value for a session timeout is 10,000 milliseconds. The minimum timeout for a session is 5,000 milliseconds. Calling #onStartSession(Context, String) within the set time will cause the previous session to resume. Calling #onStartSession(Context, String) after the set amount of time has passed will result in a new session being created.
      See Also:
    • withCaptureUncaughtExceptions

      public FlurryAgent.Builder withCaptureUncaughtExceptions(boolean captureExceptions)
      True to enable or false to disable the ability to catch all uncaught exceptions and have them reported back to Flurry.
      Parameters:
      captureExceptions - true to enable, false to disable.
      Returns:
      The Builder instance.
    • withPulseEnabled

      @Deprecated public FlurryAgent.Builder withPulseEnabled(boolean pulseEnabled)
      Deprecated.
      The Pulse is not available anymore and the API will be removed in an upcoming release
      True to enable or false to disable Flurry Pulse.
      Parameters:
      pulseEnabled - true to enable, false to disable.
      Returns:
      The Builder instance.
    • withIncludeBackgroundSessionsInMetrics

      public FlurryAgent.Builder withIncludeBackgroundSessionsInMetrics(boolean includeBackgroundSessionsInMetrics)
      True if this session should be added to total sessions/DAUs when applicationstate is inactive or background. Default is set to true.
      Parameters:
      includeBackgroundSessionsInMetrics - if background and inactive session should be counted toward dau
    • withReportLocation

      public FlurryAgent.Builder withReportLocation(boolean reportLocation)
      True to enable or false to disable Location report. Defaults to false.
      Parameters:
      reportLocation - true to enable Location report, false to disable it.
    • withSslPinningEnabled

      public FlurryAgent.Builder withSslPinningEnabled(boolean sslPinningEnabled)
      True to enable or false to disable SSL Pinning for Flurry Analytics connection. Defaults to false. Turn on to add SSL Pinning protection for the Flurry Analytics connections. Disable it if your app is using proxy or any services that are not compliant with SSL Pinning.
      Parameters:
      sslPinningEnabled - true to enable SSL Pinning for Flurry Analytics connection, false to disable it.
      Returns:
      The Builder instance.
    • withPerformanceMetrics

      public FlurryAgent.Builder withPerformanceMetrics(int performanceMetrics)
      Set flags for performance metrics.
      Parameters:
      performanceMetrics - Flags for performance metrics. E.g., FlurryPerformance.COLD_START | FlurryPerformance.SCREEN_TIME
      Returns:
      The Builder instance.
    • withModule

      public FlurryAgent.Builder withModule(@NonNull FlurryModule module) throws IllegalArgumentException
      To register Flurry add-on modules, create each module and pass it in to this builder item
      Parameters:
      module - the add-on module
      Returns:
      The Builder instance
      Throws:
      IllegalArgumentException
    • withGppConsent

      public FlurryAgent.Builder withGppConsent(@NonNull String gppString, @NonNull Set<Integer> gppSectionIds)
      Set Flurry Consent for the IAB Global Privacy Platform (GPP). To pass an IAB string to Flurry, see Consent and FlurryConsent
      Parameters:
      gppString - IAB GPP String.
      gppSectionIds - Integer set of IAB GPP section ids that are applicable for this bid request.
      Returns:
      The Builder instance
    • withConsent

      public FlurryAgent.Builder withConsent(@NonNull Consent flurryConsent)
      Set Flurry Consent. To pass an IAB string to Flurry, see FlurryConsent
      Parameters:
      flurryConsent - Flurry Consent
      Returns:
      The Builder instance
    • withDataSaleOptOut

      public FlurryAgent.Builder withDataSaleOptOut(boolean isOptOut)
      True to opt-out data sale or false to opt-in data sale
      Parameters:
      isOptOut - true to opt-out data sale, false to opt-in
      Returns:
      The Builder instance
    • withSessionForceStart

      public FlurryAgent.Builder withSessionForceStart(boolean isSessionForceStart)
      Force a session to be started after Flurry initialization Set to true if Flurry is initialized after Application onCreate() method.
      Parameters:
      isSessionForceStart - true to force a session start after Flurry initialization, otherwise false
      Returns:
      The Builder instance
    • build

      public void build(@NonNull android.content.Context context, @NonNull String apiKey)