Package com.flurry.android
Class FlurryAgent.Builder
java.lang.Object
com.flurry.android.FlurryAgent.Builder
- Enclosing class:
- FlurryAgent
Builder Pattern class for FlurryAgent.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
withCaptureUncaughtExceptions
(boolean captureExceptions) True to enable or false to disable the ability to catch all uncaught exceptions and have them reported back to Flurry.withConsent
(Consent flurryConsent) Set Flurry Consent.withContinueSessionMillis
(long sessionMillis) Set the timeout for expiring a Flurry session.withDataSaleOptOut
(boolean isOptOut) True to opt-out data sale or false to opt-in data salewithGppConsent
(String gppString, Set<Integer> gppSectionIds) Set Flurry Consent for the IAB Global Privacy Platform (GPP).withIncludeBackgroundSessionsInMetrics
(boolean includeBackgroundSessionsInMetrics) True if this session should be added to total sessions/DAUs when applicationstate is inactive or background.withListener
(FlurryAgentListener listener) Sets the listener.withLogEnabled
(boolean enableLog) True to enable or false to disable the internal logging for the Flurry SDK.withLogLevel
(int logLevel) Set the log level of the internal Flurry SDK logging.withModule
(FlurryModule module) To register Flurry add-on modules, create each module and pass it in to this builder itemwithPerformanceMetrics
(int performanceMetrics) Set flags for performance metrics.withPulseEnabled
(boolean pulseEnabled) Deprecated.The Pulse is not available anymore and the API will be removed in an upcoming releasewithReportLocation
(boolean reportLocation) True to enable or false to disable Location report.withSessionForceStart
(boolean isSessionForceStart) Force a session to be started after Flurry initialization Set to true if Flurry is initialized after Application onCreate() method.withSslPinningEnabled
(boolean sslPinningEnabled) True to enable or false to disable SSL Pinning for Flurry Analytics connection.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
withListener
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
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
Set the log level of the internal Flurry SDK logging.- Parameters:
logLevel
- The level to set it to.- Returns:
- The Builder instance.
-
withContinueSessionMillis
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
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.The Pulse is not available anymore and the API will be removed in an upcoming releaseTrue 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
True to enable or false to disable Location report. Defaults to false.- Parameters:
reportLocation
- true to enable Location report, false to disable it.
-
withSslPinningEnabled
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
Set flags for performance metrics.- Parameters:
performanceMetrics
- Flags for performance metrics. E.g., FlurryPerformance.COLD_START | FlurryPerformance.SCREEN_TIME- Returns:
- The Builder instance.
-
withModule
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, seeConsent
andFlurryConsent
- 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
Set Flurry Consent. To pass an IAB string to Flurry, seeFlurryConsent
- Parameters:
flurryConsent
- Flurry Consent- Returns:
- The Builder instance
-
withDataSaleOptOut
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
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
-