Edit in GitHubLog an issue

Lifecycle API reference

extensionVersion

The extensionVersion() API returns the version of the Lifecycle extension that is registered with the Mobile Core extension.

To get the version of the Lifecycle extension, use the following code sample:

Java

Syntax

Copied to your clipboard
public static String extensionVersion()

Example

Copied to your clipboard
final String lifecycleExtensionVersion = Lifecycle.extensionVersion();

lifecycleStart

Starts the collection of lifecycle data.

For Analytics use case: Use this API to start a new lifecycle session or resume a previously paused lifecycle session. If a previously paused session timed out, then a new session is created. If a current session is running, then calling this method does nothing.

For Platform use case: Use this API to dispatch a Lifecycle Application Foreground event when the application is launched.

Java

This method should be called from the Activity onResume method.

Syntax

Copied to your clipboard
public static void lifecycleStart(@Nullable final Map<String, String> additionalContextData)

Example

Copied to your clipboard
MobileCore.lifecycleStart(null);

If you need to collect additional lifecycle data:

Copied to your clipboard
contextData.put("myapp.category", "Game");
MobileCore.lifecycleStart(additionalContextData);

lifecyclePause

Pauses the collection of lifecycle data.

For Analytics use case: Use this API to pause the collection of lifecycle data.

For Platform use case: Use this API to dispatch a Lifecycle Application Background event when the application closes.

Java

Syntax

Copied to your clipboard
public static void lifecyclePause()

Example

Copied to your clipboard
MobileCore.lifecyclePause();

registerExtension

Registers the Lifecycle extension with the Mobile Core.

Java

Syntax

Copied to your clipboard
public static void registerExtension()

Example

Copied to your clipboard
Lifecycle.registerExtension();
export const _frontmatter = {}
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.