If you have implemented SDK's older React Native libraries (ACP-prefixed React Native libraries) in your mobile app, then the following steps will help you migrate your implementation to the latest React Native libraries(AEP-prefixed React Native libraries).
Open your app's package.json file and replace the ACP-prefixed packages with the corresponding AEP-prefixed packages. For example, the following code snippet shows the changes for core
library:
...
"dependencies": {
"react-native": "0.64.2",
- "@adobe/react-native-acpcore": "^2.0.0"
+ "@adobe/react-native-aepcore": "^7.0.0",
...
},
At this time, the following ACP-prefix libraries can be switched out with their respective AEP-prefix libraries. However, ACP and AEP React Native libraries are not compatible. For extensions not supported in AEP-prefixed libraries, you should remove those packages from your package.json file.
React Native (ACP) | React Native (AEP) |
---|---|
@adobe/react-native-acpcore | @adobe/react-native-aepcore |
@adobe/react-native-acpuserprofile | @adobe/react-native-aepuserprofile |
@adobe/react-native-acpplaces | @adobe/react-native-aepplaces |
@adobe/react-native-acpplaces-monitor | NA |
@adobe/react-native-acpanalytics | NA, Analytics workflows supported through Edge Network or Edge Bridge extensions. Please refer to the Note below. |
@adobe/react-native-acpmedia | NA |
@adobe/react-native-acpaudience | NA |
@adobe/react-native-acptarget | @adobe/react-native-aeptarget, Analytics for Target (A4T) is not supported. If you want to use the A4T workflow, it is supported through Edge Network and Optimize extensions. |
@adobe/react-native-acpcampaign | NA |
@adobe/react-native-aepassurance:2.x (compatible with ACP libraries) | @adobe/react-native-aepassurance:4.x (compatible with AEP libraries) |
Note: Analytics library is not supported in AEP React Native. For implementing the Analytics workflow, register and configure the Edge Network or Edge Bridge libraries. Please refer to migrate to Edge Network for more info.
Note
Starting from Adobe Experience Platform React native 7.x, there is no longer a need to initialize the SDK on the native platforms, as was required in earlier versions.
Remove the deprecated registration code and the extensions that are not supported in AEP React Native libraries.
Initialize AEP SDK in the React native application:
Example
MobileCore.initializeWithAppId ("YOUR-APP-ID").then(() => {
console.log("AEP SDK Initialized");
}).catch((error) => {
console.log("AEP SDK Initialization error", error);
});
Refer to the initializing details info here.
- ACP
ACPCore.collectPii(data: [String : String])
MobileCore.collectPii(data: Record<string, string>)
- ACP
ACPCore.dispatchEvent(event: ACPExtensionEvent): Promise<boolean>
MobileCore.dispatchEvent(event: Event): Promise<boolean>
- ACP
ACPCore.dispatchEventWithResponseCallback(event: ACPExtensionEvent): Promise<ACPExtensionEvent>
MobileCore.dispatchEventWithResponseCallback(event: Event, timeoutMS:Number): Promise<Event>
- ACP
ACPCore.extensionVersion(): Promise<string>
MobileCore.extensionVersion(): Promise<string>
- ACP
ACPCore.getLogLevel(): Promise<string>
MobileCore.getLogLevel(): Promise<LogLevel>
- ACP
ACPCore.getSdkIdentities(): Promise<?string>
MobileCore.getSdkIdentities(): Promise<string>
- ACP
ACPCore.getPrivacyStatus(): Promise<string>
MobileCore.getPrivacyStatus(): Promise<string>
- ACP
ACPCore.log(logLevel: string, tag: string, message: string)
-
AEP
Not Supported.
- ACP
ACPCore.resetIdentities()
MobileCore.resetIdentities()
- ACP
ACPCore.setPrivacyStatus(privacyStatus: string)
MobileCore.setPrivacyStatus(privacyStatus: string)
- ACP
ACPCore.setLogLevel(mode: string)
MobileCore.setLogLevel(mode: LogLevel)
- ACP
ACPCore.updateConfiguration(configMap?: { string: any })
MobileCore.updateConfiguration(configMap?: Record<string, any>)
- ACP
ACPIdentity.appendVisitorInfoForURL(baseURL?: String): Promise<?string>
Identity.appendVisitorInfoForURL(baseURL?: String): Promise<string>
- ACP
ACPIdentity.extensionVersion(): Promise<string>
Identity.extensionVersion(): Promise<string>
- ACP
ACPIdentity.getUrlVariables(): Promise<?string>
Identity.getUrlVariables(): Promise<string>
- ACP
ACPIdentity.getIdentifiers(): Promise<Array<?ACPVisitorID>>
Identity.getIdentifiers(): Promise<Array<VisitorID>>
- ACP
ACPIdentity.getExperienceCloudId(): Promise<?string>
Identity.getExperienceCloudId(): Promise<string>
- ACP
ACPIdentity.syncIdentifier(identifierType: String, identifier: String, authenticationState: string)
Identity.syncIdentifier(identifierType: String, identifier: String, authenticationState: MobileVisitorAuthenticationState)
- ACP
ACPIdentity.syncIdentifiers(identifiers?: { string: string })
Identity.syncIdentifiers(identifiers?: Record<string, string>)
- ACP
ACPIdentity.syncIdentifiersWithAuthState(identifiers?: { string: string }, authenticationState: string)
Identity.syncIdentifiersWithAuthState(identifiers: Record<string, string> | null, authenticationState: MobileVisitorAuthenticationState)
- ACP
ACPCore.setAdvertisingIdentifier(advertisingIdentifier?: String)
MobileCore.setAdvertisingIdentifier(advertisingIdentifier?: string)
- ACP
ACPCore.setPushIdentifier(pushIdentifier?: String)
MobileCore.setPushIdentifier(pushIdentifier?: string)
- ACP
ACPLifecycle.extensionVersion(): Promise<string>
Lifecycle.extensionVersion(): Promise<string>
- ACP
ACPSignal.extensionVersion(): Promise<string>
Signal.extensionVersion(): Promise<string>
- ACP
ACPUserProfile.extensionVersion(): Promise<string>
UserProfile.extensionVersion(): Promise<string>
- ACP
ACPUserProfile.removeUserAttribute(attributeName: string)
UserProfile.removeUserAttributes(attributeNames: Array<string>)
- ACP
ACPUserProfile.updateUserAttributes(attributeMap: { string: any })
ACPUserProfile.updateUserAttribute(attributeName: string, attributeValue: string)
UserProfile.updateUserAttributes(attributeMap: Record<string, any>)