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

Copied to your clipboard
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.

Java

This method should be called from the Activity onResume method.

Syntax

Copied to your clipboard
public static void lifecycleStart(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.

Java

Syntax

Copied to your clipboard
public static void lifecyclePause()

Example

Copied to your clipboard
MobileCore.lifecyclePause();
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.