Edit in GitHubLog an issue

Add the required dependencies to your project by including them in the app's Gradle file.

Copied to your clipboard
implementation(platform("com.adobe.marketing.mobile:sdk-bom:3.+"))
implementation("com.adobe.marketing.mobile:core")
implementation("com.adobe.marketing.mobile:identity")
implementation("com.adobe.marketing.mobile:target")

Add the required dependencies to your project by including them in the app's Gradle file.

Copied to your clipboard
implementation platform('com.adobe.marketing.mobile:sdk-bom:3.+')
implementation 'com.adobe.marketing.mobile:core'
implementation 'com.adobe.marketing.mobile:identity'
implementation 'com.adobe.marketing.mobile:target'

Add the required dependencies to your project using CocoaPods. Add following pods in your Podfile:

Copied to your clipboard
use_frameworks!
target 'YourTargetApp' do
pod 'AEPCore','~>5.0'
pod 'AEPIdentity','~>5.0'
pod 'AEPTarget','~>5.0'
end

Java

Syntax

Copied to your clipboard
public TargetOrder(final String id, final double total, final List<String> purchasedProductIds)

Example

Copied to your clipboard
List<String> purchasedProductIds = new ArrayList<String>();
purchasedProductIds.add("34");
purchasedProductIds.add("125");
TargetOrder targetOrder = new TargetOrder("123", 567.89, purchasedProductIds);

Swift

Syntax

Copied to your clipboard
public init(id: String, total: Double = 0, purchasedProductIds: [String]? = nil)

Example

Copied to your clipboard
let order = TargetOrder(id: "id1", total: 1.0, purchasedProductIds: ["ppId1"])

Objective-C

Syntax

Copied to your clipboard
- (nonnull instancetype) initWithId: (nonnull NSString*) id total: (double) total purchasedProductIds: (nullable NSArray<NSString*>*) purchasedProductIds;

Example

Copied to your clipboard
AEPTargetOrder *order = [[AEPTargetOrder alloc] initWithId:@"id1" total:1.0 purchasedProductIds:@[@"ppId1"]];

Java

Syntax

Copied to your clipboard
public TargetProduct(final String id, final String categoryId)

Example

Copied to your clipboard
TargetProduct targetProduct = new TargetProduct("123", "Books");

Swift

Syntax

Copied to your clipboard
public init(productId: String, categoryId: String? = nil)

Example

Copied to your clipboard
let product = TargetProduct(productId: "pId1", categoryId: "cId1")

Objective-C

Syntax

Copied to your clipboard
- (nonnull instancetype) initWithProductId:(nonnull NSString*) productId categoryId:(nullable NSString*) categoryId;

Example

Copied to your clipboard
AEPTargetProduct *product =[[AEPTargetProduct alloc] initWithProductId:@"pId1" categoryId:@"cId1"];

Java

Syntax

Copied to your clipboard
TargetParameters targetParameters = new TargetParameters.Builder()
.parameters(new HashMap<String, String>())
.profileParameters(new HashMap<String, String>())
.product(new TargetProduct("productId", "productCategoryId"))
.order(new TargetOrder("orderId", 0.0, new ArrayList<String>()))
.build();

Example

Copied to your clipboard
List<String> purchasedProductIds = new ArrayList<String>();
purchasedProductIds.add("34");
purchasedProductIds.add("125");
TargetOrder targetOrder = new TargetOrder("123", 567.89, purchasedProductIds);
TargetProduct targetProduct = new TargetProduct("123", "Books");
Map<String, String> mboxParameters = new HashMap<String, String>();
mboxParameters1.put("status", "platinum");
Map<String, String> profileParameters = new HashMap<String, String>();
profileParameters1.put("gender", "male");
TargetParameters targetParameters = new TargetParameters.Builder()
.parameters(mboxParameters)
.profileParameters(profileParameters)
.product(targetProduct)
.order(targetOrder)
.build();

Swift

Syntax

Copied to your clipboard
public init(parameters: [String: String]? = nil, profileParameters: [String: String]? = nil, order: TargetOrder? = nil, product: TargetProduct? = nil)

Example

Copied to your clipboard
let mboxParameters = [
"status": "Platinum"
]
let profileParameters = [
"gender": "female"
]
let order = TargetOrder(id: "id1", total: 1.0, purchasedProductIds: ["ppId1"])
let product = TargetProduct(productId: "pId1", categoryId: "cId1")
let targetParameters = TargetParameters(parameters: mboxParameters, profileParameters: profileParameters, order: order, product: product))

Objective-C

Syntax

Copied to your clipboard
- (nonnull instancetype) initWithParameters:(nullable NSDictionary<NSString*, NSString*>*) parameters profileParameters:(nullable NSDictionary<NSString*, NSString*>*) profileParameters order:(nullable AEPTargetOrder*) order product:(nullable AEPTargetProduct*) product;

Example

Copied to your clipboard
NSDictionary *mboxParameters = @{@"status":@"Platinum"};
NSDictionary *profileParameters = @{@"gender":@"female"};
AEPTargetProduct *product =[[AEPTargetProduct alloc] initWithProductId:@"pId1" categoryId:@"cId1"];
AEPTargetOrder *order = [[AEPTargetOrder alloc] initWithId:@"id1" total:1.0 purchasedProductIds:@[@"ppId1"]];
AEPTargetParameters * targetParams = [[AEPTargetParameters alloc] initWithParameters:mboxParameters profileParameters:profileParameters order:order product:product];

On Android, when the application is launched as a result of a deep link, the Mobile Core's collectLaunchInfo API is internally invoked, and the Target activity and deep link information is extracted from the Intent extras.

The SDK can only collect information from the launching Activity if setApplication has been called. Setting the Application is only necessary on an Activity that is also an entry point for your application. However, setting the Application on each Activity has no negative impact and ensures that the SDK always has the necessary reference to your Application. We recommend that you call setApplication API in each of your Activities.

On iOS, the Mobile Core's collectLaunchInfo API can be invoked with the Target preview deep link as shown below:

Swift

Example

Copied to your clipboard
MobileCore.collectLaunchInfo(["adb_deeplink" : "com.adobe.targetpreview://app.adobetarget.com?at_preview_token=tokenFromTarget"])

Objective-C

Example

Copied to your clipboard
[AEPMobileCore collectLaunchInfo:@{@"adb_deeplink" : @"com.adobe.targetpreview://app.adobetarget.com?at_preview_token=tokenFromTarget"}];
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2025 Adobe. All rights reserved.