BrazeActivityLifecycleCallbackListener

open class BrazeActivityLifecycleCallbackListener @JvmOverloads constructor(sessionHandlingEnabled: Boolean = true, registerInAppMessageManager: Boolean = true, inAppMessagingRegistrationBlocklist: Set<Class<*>?>? = emptySet<Class<*>>(), sessionHandlingBlocklist: Set<Class<*>?>? = emptySet<Class<*>>()) : Application.ActivityLifecycleCallbacks

Can be used to automatically handle Braze lifecycle methods. Optionally, openSession() and closeSession() are called on onActivityStarted and onActivityStopped respectively. The InAppMessageManager methods of registerInAppMessageManager() and unregisterInAppMessageManager() can be optionally called here as well. Note: This callback should not be set in any Activity. It must be set in the Application class of your app.

Parameters

sessionHandlingEnabled

When true, handles calling openSession and closeSession in onActivityStarted and onActivityStopped respectively.

registerInAppMessageManager
inAppMessagingRegistrationBlocklist

A set of Activitys for which in-app message registration will not occur. Each class should be retrieved via Activity.getClass. If null, an empty set is used instead.

sessionHandlingBlocklist

A set of Activitys for which session handling will not occur. Each class should be retrieved via Activity.getClass. If null, an empty set is used instead.

Constructors

Link copied to clipboard
constructor(sessionHandlingEnabled: Boolean = true, registerInAppMessageManager: Boolean = true, inAppMessagingRegistrationBlocklist: Set<Class<*>?>? = emptySet<Class<*>>(), sessionHandlingBlocklist: Set<Class<*>?>? = emptySet<Class<*>>())
constructor(inAppMessagingRegistrationBlocklist: Set<Class<*>?>?, sessionHandlingBlocklist: Set<Class<*>?>? = emptySet<Class<*>>())

Constructor that sets a blocklist for session handling and BrazeInAppMessageManager registration while also enabling both features.

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun onActivityCreated(activity: Activity, bundle: Bundle?)
Link copied to clipboard
open override fun onActivityDestroyed(activity: Activity)
Link copied to clipboard
open override fun onActivityPaused(activity: Activity)
Link copied to clipboard
open fun onActivityPostCreated(activity: Activity, savedInstanceState: Bundle?)
Link copied to clipboard
open fun onActivityPostDestroyed(activity: Activity)
Link copied to clipboard
open fun onActivityPostPaused(activity: Activity)
Link copied to clipboard
open fun onActivityPostResumed(activity: Activity)
Link copied to clipboard
open fun onActivityPostSaveInstanceState(activity: Activity, outState: Bundle)
Link copied to clipboard
open fun onActivityPostStarted(activity: Activity)
Link copied to clipboard
open fun onActivityPostStopped(activity: Activity)
Link copied to clipboard
open fun onActivityPreCreated(activity: Activity, savedInstanceState: Bundle?)
Link copied to clipboard
open fun onActivityPreDestroyed(activity: Activity)
Link copied to clipboard
open fun onActivityPrePaused(activity: Activity)
Link copied to clipboard
open fun onActivityPreResumed(activity: Activity)
Link copied to clipboard
open fun onActivityPreSaveInstanceState(activity: Activity, outState: Bundle)
Link copied to clipboard
open fun onActivityPreStarted(activity: Activity)
Link copied to clipboard
open fun onActivityPreStopped(activity: Activity)
Link copied to clipboard
open override fun onActivityResumed(activity: Activity)
Link copied to clipboard
open override fun onActivitySaveInstanceState(activity: Activity, bundle: Bundle)
Link copied to clipboard
open override fun onActivityStarted(activity: Activity)
Link copied to clipboard
open override fun onActivityStopped(activity: Activity)
Link copied to clipboard

Registers this listener directly against the Application. Equivalent to:

Link copied to clipboard

Sets the Activity.getClass blocklist for which in-app message registration will not occur.

Link copied to clipboard

Sets the Activity.getClass blocklist for which session handling will not occur.

Link copied to clipboard

Determines if this Activity should be ignored for the purposes of session tracking or in-app message registration.