Edit in GitHubLog an issue

Java

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

Swift

Copied to your clipboard
let lifecycleExtensionVersion = ACPLifecycle.extensionVersion()

Objective-C

Copied to your clipboard
NSString *lifecycleExtensionVersion = [ACPLifecycle extensionVersion];

JavaScript

Copied to your clipboard
ACPLifecycle.extensionVersion().then(lifecycleExtensionVersion => console.log("AdobeExperienceSDK: ACPLifecycle version: " + lifecycleExtensionVersion));

Dart

Copied to your clipboard
String lifeycycleExtensionVersion = await FlutterACPLifecycle.extensionVersion;

Cordova

Copied to your clipboard
ACPLifecycle.extensionVersion(function(version) {
console.log("ACPLifecycle version: " + version);
}, function(error) {
console.log(error);
});

C#

Copied to your clipboard
string lifecycleVersion = ACPLifecycle.ExtensionVersion();

C#

Copied to your clipboard
string lifecycleVersion = ACPLifecycle.ExtensionVersion();

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);

Swift

Copied to your clipboard
ACPCore.lifecycleStart(["state": "appResume"])

Objective-C

Syntax

Copied to your clipboard
+ (void) lifecycleStart: (nullable NSDictionary<NSString*, NSString*>*) additionalContextData;

Example

Copied to your clipboard
[ACPCore lifecycleStart:nil];

If you need to collect additional lifecycle data:

Copied to your clipboard
[ACPCore lifecycleStart:@{@"state": @"appResume"}];

JavaScript

When using React Native, starting to collect lifecycle data should be done in native code which is shown under the Android and iOS tabs.

Cordova

When using Cordova, the lifecycleStart method call must be made in native code which is shown under the Android and iOS tabs.

C#

When using Unity, the LifecycleStart method call must be made from the OnApplicationPause method.

Copied to your clipboard
private void OnApplicationPause(bool pauseStatus)
{
if (!pauseStatus)
{
ACPCore.LifecyclePause();
}
else
{
var cdata = new Dictionary<string, string>();
cdata.Add("launch.data", "added");
ACPCore.LifecycleStart(cdata);
}
}

C#

iOS

When using iOS, the LifecycleStart method call must be made from the OnActivated method.

Copied to your clipboard
public override void OnActivated(UIApplication uiApplication)
{
base.OnActivated(uiApplication);
ACPCore.LifecycleStart(null);
}

Android

When using Android, the LifecycleStart method call must be made from the OnResume method.

Copied to your clipboard
protected override void OnResume()
{
base.OnResume();
ACPCore.LifecycleStart(null);
}

Java

Syntax

Copied to your clipboard
public static void lifecyclePause()

Example

Copied to your clipboard
MobileCore.lifecyclePause();

Swift

Copied to your clipboard
ACPCore.lifecyclePause()

Objective-C

Syntax

Copied to your clipboard
+ (void) lifecyclePause;

Example

Copied to your clipboard
[ACPCore lifecyclePause];

JavaScript

When using React Native, pausing the collection of lifecycle data should be done in native code which is shown under the Android and iOS (ACP 2.x) tabs.

Cordova

When using Cordova, the lifecyclePause method call must be made in native code which is shown under the Android and iOS tabs.

C#

When using Unity, the LifecyclePause method call must be made from the OnApplicationPause method.

Copied to your clipboard
private void OnApplicationPause(bool pauseStatus)
{
if (!pauseStatus)
{
ACPCore.LifecyclePause();
}
else
{
var cdata = new Dictionary<string, string>();
cdata.Add("launch.data", "added");
ACPCore.LifecycleStart(cdata);
}
}

C#

iOS

When using iOS, the LifecyclePause method call must be made from the OnResignActivation method.

Copied to your clipboard
public override void OnResignActivation(UIApplication uiApplication)
{
base.OnResignActivation(uiApplication);
ACPCore.LifecyclePause();
}

Android

When using Android, the LifecyclePause method call must be made from the OnPause method.

Copied to your clipboard
protected override void OnPause()
{
base.OnPause();
ACPCore.LifecyclePause();
}
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.