The Adobe Experience Platform Consent mobile extension enables consent preferences collection from your mobile app when using the Adobe Experience Platform Mobile SDK and the Edge Network extension.
- In Data Collection UI, in your mobile property, select the Extensions tab.
- On the Catalog tab, locate or search for the Consent extension, and select Install.
- Set your desired default consent level.
- Select Save.
- Follow the publishing process to update SDK configuration.
{% hint style="info" %} In order to ingest and use the data collected by this extension, follow the guide on ingesting data using the Consents and Preferences data type. {% endhint %}
{% hint style="warning" %} The use of this extension is currently limited to the setting (and enforcement) of client-side, macro consent flags. While SDK APIs allow for granular and global consent preference collection, flags are not consistently enforced with upstream applications and therefore will not accommodate use cases that rely on global/granular consent preferences. {% endhint %}
{% tabs %} {% tab title="Android" %}
-
Add the Mobile Core and Edge extensions to your project using the app's Gradle file.
implementation 'com.adobe.marketing.mobile:core:1.+' implementation 'com.adobe.marketing.mobile:edge:1.+' implementation 'com.adobe.marketing.mobile:edgeidentity:1.+' implementation 'com.adobe.marketing.mobile:edgeconsent:1.+'
-
Import the Mobile Core and Edge extensions in your Application class.
import com.adobe.marketing.mobile.MobileCore; import com.adobe.marketing.mobile.Edge; import com.adobe.marketing.mobile.edge.identity.Identity; import com.adobe.marketing.mobile.edge.consent.Consent;
{% endtab %}
{% tab title="iOS (AEP 3.x)" %}
-
Add the Mobile Core and Edge extensions to your project using Cocoapods. Add following pods in your
Podfile
:use_frameworks! target 'YourTargetApp' do pod 'AEPCore' pod 'AEPEdge' pod 'AEPEdgeIdentity' pod 'AEPEdgeConsent' end
-
Import the Mobile Core and Edge libraries:
// AppDelegate.swift
import AEPCore
import AEPEdge
import AEPEdgeIdentity
import AEPEdgeConsent
// AppDelegate.h
@import AEPCore;
@import AEPEdge;
@import AEPEdgeIdentity;
@import AEPEdgeConsent;
{% endtab %}
{% tab title="iOS (ACP 2.x)" %}
This extension is built on the AEPCore (3.x) and it is not compatible with ACPCore (2.x). Please follow the guide for migrating to the Swift AEPCore.
{% endtab %}
{% endtabs %}
{% tabs %} {% tab title="Android" %}
public class MobileApp extends Application {
@Override
public void onCreate() {
super.onCreate();
MobileCore.setApplication(this);
try {
Edge.registerExtension();
Consent.registerExtension(); // register Consent
Identity.registerExtension();
// register other extensions
MobileCore.start(new AdobeCallback() {
@Override
public void call(final Object o) {
MobileCore.configureWithAppID("yourAppId");
}});
} catch (Exception e) {
//Log the exception
}
}
}
{% endtab %}
{% tab title="iOS AEP(3.x)" %}
// AppDelegate.swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
MobileCore.registerExtensions([Identity.self, Edge.self, Consent.self], {
MobileCore.configureWith(appId: "yourLaunchEnvironmentID")
})
...
}
// AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[AEPMobileCore registerExtensions:@[AEPMobileEdgeIdentity.class, AEPMobileEdge.class, AEPMobileEdgeConsent.class] completion:^{
[AEPMobileCore configureWithAppId: @"yourLaunchEnvironmentID"];
}];
...
}
{% endtab %} {% endtabs %}
To update the SDK configuration programmatically, use the following information to change the Edge Consent configuration values.
Key | Required | Description | Data Type |
---|---|---|---|
consent.default | No | Consents in XDM format. For more details, see Privacy/Personalization/Marketing Preferences (Consents) Schema. | Map |