Adobe Experience Platform support for React Native apps.
npm install @adobe/react-native-aepuserprofile

@adobe/react-native-aepcore is a wrapper around the iOS and Android Adobe Experience Platform User Profile Extension to allow for integration with React Native applications.
The UserProfile extension has the following peer dependency, which must be installed prior to installing the UserProfile extension:
- Core
See Requirements and Installation instructions on the main page
Install the @adobe/react-native-aepuserprofile package:
NPM:
``bash`
npm install @adobe/react-native-aepuserprofile
Yarn:
`bash`
yarn add @adobe/react-native-aepuserprofile
To initialize the SDK, use the following methods:
- MobileCore.initializeWithAppId(appId)
- MobileCore.initialize(initOptions)
Refer to the root Readme for more information about the SDK setup.
In your React Native application, import the UserProfile extension as follows:
`typescript`
import { UserProfile } from "@adobe/react-native-aepuserprofile";
Returns the version of the User Profile extension
Syntax
`typescript`
extensionVersion(): Promise
Example
`typescript`
UserProfile.extensionVersion().then((version) =>
console.log("AdobeExperienceSDK: UserProfile version: " + version)
);
Gets the user profile attributes with the given keys.
Syntax
`typescript`
getUserAttributes(attributeNames: Array
Example
`typescript`
UserProfile.getUserAttributes(["mapKey", "mapKey1"]).then((map) =>
console.log("AdobeExperienceSDK: UserProfile getUserAttributes: " + map)
);
Removes the user profile attributes for the given keys.
Syntax
`typescript`
removeUserAttributes(attributeNames: Array
Example
`typescript`
UserProfile.removeUserAttributes(["mapKey1"]);
Sets the user profile attributes key and value.
It allows to create/update a batch of user profile attributes.
Syntax
`typescript`
updateUserAttributes(attributeMap: Record
Example
`typescript``
let attrMap = { mapKey: "mapValue", mapKey1: "mapValue1" };
UserProfile.updateUserAttributes(attrMap);