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 Experience Platform Launch, in your mobile property, click the Extensions tab.
- On the Catalog tab, locate or search for the Consent extension, and click Install.
- Set your desired default consent level.
- Click Save.
- Follow the publishing process to update SDK configuration.
{% 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.*;
{% endtab %}
{% tab title="iOS" %}
-
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 %} {% endtabs %}
{% tabs %} {% tab title="Android" %}
public class MobileApp extends Application {
@Override
public void onCreate() {
super.onCreate();
MobileCore.setApplication(this);
MobileCore.configureWithAppID("yourLaunchEnvironmentID");
try {
Edge.registerExtension();
Consent.registerExtension(); // register Consent
Identity.registerExtension();
MobileCore.start(new AdobeCallback() {
@Override
public void call(final Object o) {
// processing after start
}});
} catch (Exception e) {
//Log the exception
}
}
}
{% endtab %}
{% tab title="iOS" %}
// 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 |