
Product
Introducing Module Reachability: Focus on the Vulnerabilities That Matter
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
@adobe/react-native-aeptarget
Advanced tools
Adobe Experience Platform support for React Native apps.
@adobe/react-native-aeptarget
is a wrapper around the iOS and Android AEP Target SDK to allow integration with React Native applications.
The Adobe Experience Platform Target extension has the following peer dependency, which must be installed prior to installing the target extension:
See Requirements and Installation instructions on the main page
Install the @adobe/react-native-aeptarget
package:
NPM:
npm install @adobe/react-native-aeptarget
Yarn:
yarn add @adobe/react-native-aeptarget
Initialization of the SDK should be done in native code, documentation on how to initialize the SDK can be found here.
Example:
iOS
@import AEPCore;
@import AEPLifecycle;
@import AEPEdge;
@import AEPTarget;
@implementation AppDelegate
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[AEPMobileCore setLogLevel: AEPLogLevelDebug];
[AEPMobileCore configureWithAppId:@"yourAppID"];
const UIApplicationState appState = application.applicationState;
[AEPMobileCore registerExtensions: @[AEPMobileEdge.class, AEPMobileTarget.class] completion:^{
if (appState != UIApplicationStateBackground) {
[AEPMobileCore lifecycleStart:nil];
}
}];
return YES;
}
@end
Android
import com.adobe.marketing.mobile.AdobeCallback;
import com.adobe.marketing.mobile.InvalidInitException;
import com.adobe.marketing.mobile.Lifecycle;
import com.adobe.marketing.mobile.LoggingMode;
import com.adobe.marketing.mobile.MobileCore;
import com.adobe.marketing.mobile.Edge;
import com.adobe.marketing.mobile.Target;
...
import android.app.Application;
...
public class MainApplication extends Application implements ReactApplication {
...
@Override
public void on Create(){
super.onCreate();
...
MobileCore.setApplication(this);
MobileCore.setLogLevel(LoggingMode.DEBUG);
MobileCore.configureWithAppID("yourAppID");
List<Class<? extends Extension>> extensions = Arrays.asList(
Edge.EXTENSION,
Target.EXTENSION);
MobileCore.registerExtensions(extensions, o -> {
MobileCore.lifecycleStart(null);
});
}
}
import {
Target,
TargetOrder,
TargetParameters,
TargetPrefetchObject,
TargetProduct,
TargetRequestObject,
} from "@adobe/react-native-aeptarget";
Syntax
extensionVersion(): Promise<string>
Example
const version = await Target.extensionVersion();
console.log("AdobeExperienceSDK: AEPTarget version: " + version);
Syntax
getThirdPartyId(): Promise<string>
Example
const id = await Target.getThirdPartyId();
console.log("AdobeExperienceSDK: Third Party ID: " + id);
Syntax
setThirdPartyId(<id>): void
Example
Target.setThirdPartyId("thirdPartyId");
Syntax
resetExperience(): void
Example
Target.resetExperience();
Syntax
getSessionId(): Promise<string>
Example
const id = await Target.getSessionId();
console.log("AdobeExperienceSDK: Session ID " + id);
Syntax
getTntId(): Promise<string>
Example
const id = await Target.getTntId();
console.log("AdobeExperienceSDK: TNT ID " + id);
Syntax
retrieveLocationContent(Array<TargetRequestObject>, <TargetParameters>): void
Example
var mboxParameters1 = { status: "platinum" };
var mboxParameters2 = { userType: "Paid" };
var purchaseIDs = ["34", "125"];
var targetOrder = new TargetOrder("ADCKKIM", 344.3, purchaseIDs);
var targetProduct = new TargetProduct("24D3412", "Books");
var parameters1 = new TargetParameters(mboxParameters1, null, null, null);
var request1 = new TargetRequestObject(
"mboxName2",
parameters1,
"defaultContent1",
(error, content) => {
if (error) {
console.error(error);
} else {
console.log("Adobe content:" + content);
}
}
);
var parameters2 = new TargetParameters(
mboxParameters1,
{ profileParameters: "parameterValue" },
targetProduct,
targetOrder
);
var request2 = new TargetRequestObject(
"mboxName2",
parameters2,
"defaultContent2",
(error, content) => {
if (error) {
console.error(error);
} else {
console.log("Adobe content:" + content);
}
}
);
var locationRequests = [request1, request2];
var profileParameters1 = { ageGroup: "20-32" };
var parameters = new TargetParameters(
{ parameters: "parametervalue" },
profileParameters1,
targetProduct,
targetOrder
);
Target.retrieveLocationContent(locationRequests, parameters);
Syntax
prefetchContent(Array<TargetPrefetchObject>, <TargetParameters>): Promise<any>
Example
var mboxParameters1 = { status: "platinum" };
var mboxParameters2 = { userType: "Paid" };
var purchaseIDs = ["34", "125"];
var targetOrder = new TargetOrder("ADCKKIM", 344.3, purchaseIDs);
var targetProduct = new TargetProduct("24D3412", "Books");
var parameters1 = new TargetParameters(mboxParameters1, null, null, null);
var prefetch1 = new TargetPrefetchObject("mboxName2", parameters1);
var parameters2 = new TargetParameters(
mboxParameters1,
{ profileParameters: "parameterValue" },
targetProduct,
targetOrder
);
var prefetch2 = new TargetPrefetchObject("mboxName2", parameters2);
var prefetchList = [prefetch1, prefetch2];
var profileParameters1 = { ageGroup: "20-32" };
var parameters = new TargetParameters(
{ parameters: "parametervalue" },
profileParameters1,
targetProduct,
targetOrder
);
Target.prefetchContent(prefetchList, parameters)
.then((success) => console.log(success))
.catch((err) => console.log(err));
Syntax
Target.setSessionId(<sessionId>): void
Example
Target.setSessionId("sessionId");
Syntax
Target.setTntId(<tntId>): void
Example
Target.setTntId("tntId");
Syntax
setPreviewRestartDeeplink(<deeplink>): void;
Example
Target.setPreviewRestartDeeplink("https://www.adobe.com");
Syntax
clickedLocation(<locationName>, <TargetParameters>): void;
Example
var purchaseIDs = ["34", "125"];
var targetOrder = new TargetOrder("ADCKKIM", 344.3, purchaseIDs);
var targetProduct = new TargetProduct("24D3412", "Books");
var profileParameters1 = { ageGroup: "20-32" };
var parameters = new TargetParameters(
{ parameters: "parametervalue" },
profileParameters1,
targetProduct,
targetOrder
);
Target.clickedLocation("locationName", parameters);
Syntax
displayedLocations(Array<string>, <TargetParameters>): void;
Example
var purchaseIDs = ["34", "125"];
var targetOrder = new TargetOrder("ADCKKIM", 344.3, purchaseIDs);
var targetProduct = new TargetProduct("24D3412", "Books");
var profileParameters1 = { ageGroup: "20-32" };
var parameters = new TargetParameters(
{ parameters: "parametervalue" },
profileParameters1,
targetProduct,
targetOrder
);
Target.displayedLocations(["locationName", "locationName1"], parameters);
The Target extension exports a class TargetPrefetchObject
.
constructor(name?: string, targetParameters?: TargetParameters);
The Target extension exports a class TargetRequestObject
, which extends TargetPrefetchObject
.
constructor(name: string, targetParameters: TargetParameters, defaultContent: string);
The Target extension exports a class TargetOrder
.
constructor(orderId: string, total?: number, purchasedProductIds: Array<string>);
The Target extension exports a class TargetOrder
.
constructor(productId: string, categoryId: string);
The Target extension exports a class TargetParameters
.
constructor(parameters?: Record<string, string>, profileParameters?: Record<string, string>, product?: TargetProduct, order?: TargetOrder);
FAQs
Adobe Experience Platform support for React Native apps.
We found that @adobe/react-native-aeptarget demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 24 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
Product
Socket is introducing a new way to organize repositories and apply repository-specific security policies.
Research
Security News
Socket researchers uncovered malicious npm and PyPI packages that steal crypto wallet credentials using Google Analytics and Telegram for exfiltration.