Skip to content

Latest commit

 

History

History
340 lines (291 loc) · 10.8 KB

migration.md

File metadata and controls

340 lines (291 loc) · 10.8 KB

Migrate to the Experience Platform SDK libraries (AEP) for React Native

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).

Switch dependent packages

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.

Update SDK initialization

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.

Update API usage and references for each extension

Core

collectPii

  • ACP
ACPCore.collectPii(data: [String : String])
MobileCore.collectPii(data: Record<string, string>)

dispatchEvent

  • ACP
ACPCore.dispatchEvent(event: ACPExtensionEvent): Promise<boolean>
MobileCore.dispatchEvent(event: Event): Promise<boolean>

dispatchEventWithResponseCallback

  • ACP
ACPCore.dispatchEventWithResponseCallback(event: ACPExtensionEvent): Promise<ACPExtensionEvent>
MobileCore.dispatchEventWithResponseCallback(event: Event, timeoutMS:Number): Promise<Event>

extensionVersion

  • ACP
ACPCore.extensionVersion(): Promise<string>
MobileCore.extensionVersion(): Promise<string>

getLogLevel

  • ACP
ACPCore.getLogLevel(): Promise<string> 
MobileCore.getLogLevel(): Promise<LogLevel>

getSdkIdentities

  • ACP
ACPCore.getSdkIdentities(): Promise<?string>
MobileCore.getSdkIdentities(): Promise<string>

getPrivacyStatus

  • ACP
ACPCore.getPrivacyStatus(): Promise<string>
MobileCore.getPrivacyStatus(): Promise<string>

log

  • ACP
ACPCore.log(logLevel: string, tag: string, message: string)
  • AEP

    Not Supported.

resetIdentities

  • ACP
ACPCore.resetIdentities()
MobileCore.resetIdentities()

setPrivacyStatus

  • ACP
ACPCore.setPrivacyStatus(privacyStatus: string) 
MobileCore.setPrivacyStatus(privacyStatus: string) 

setLogLevel

  • ACP
ACPCore.setLogLevel(mode: string)
MobileCore.setLogLevel(mode: LogLevel)

updateConfiguration

  • ACP
ACPCore.updateConfiguration(configMap?: { string: any })
MobileCore.updateConfiguration(configMap?: Record<string, any>)

Identity

appendVisitorInfoForURL

  • ACP
ACPIdentity.appendVisitorInfoForURL(baseURL?: String): Promise<?string> 
Identity.appendVisitorInfoForURL(baseURL?: String): Promise<string>

extensionVersion

  • ACP
ACPIdentity.extensionVersion(): Promise<string>
Identity.extensionVersion(): Promise<string>

getUrlVariables

  • ACP
ACPIdentity.getUrlVariables(): Promise<?string>
Identity.getUrlVariables(): Promise<string>

getIdentifiers

  • ACP
ACPIdentity.getIdentifiers(): Promise<Array<?ACPVisitorID>> 
Identity.getIdentifiers(): Promise<Array<VisitorID>>

getExperienceCloudId

  • ACP
ACPIdentity.getExperienceCloudId(): Promise<?string>
Identity.getExperienceCloudId(): Promise<string>

syncIdentifier

  • ACP
ACPIdentity.syncIdentifier(identifierType: String, identifier: String, authenticationState: string)
Identity.syncIdentifier(identifierType: String, identifier: String, authenticationState: MobileVisitorAuthenticationState) 

syncIdentifiers

  • ACP
ACPIdentity.syncIdentifiers(identifiers?: { string: string })
Identity.syncIdentifiers(identifiers?: Record<string, string>)

syncIdentifiersWithAuthState

  • ACP
ACPIdentity.syncIdentifiersWithAuthState(identifiers?: { string: string }, authenticationState: string) 
Identity.syncIdentifiersWithAuthState(identifiers: Record<string, string> | null, authenticationState: MobileVisitorAuthenticationState)

setAdvertisingIdentifier

  • ACP
ACPCore.setAdvertisingIdentifier(advertisingIdentifier?: String)
MobileCore.setAdvertisingIdentifier(advertisingIdentifier?: string)

setPushIdentifier

  • ACP
ACPCore.setPushIdentifier(pushIdentifier?: String) 
MobileCore.setPushIdentifier(pushIdentifier?: string) 

Lifecycle

extensionVersion

  • ACP
ACPLifecycle.extensionVersion(): Promise<string>
Lifecycle.extensionVersion(): Promise<string>

Signal

extensionVersion

  • ACP
ACPSignal.extensionVersion(): Promise<string>
Signal.extensionVersion(): Promise<string>

UserProfile

extensionVersion

  • ACP
ACPUserProfile.extensionVersion(): Promise<string>
UserProfile.extensionVersion(): Promise<string>

removeUserAttributes

  • ACP
ACPUserProfile.removeUserAttribute(attributeName: string)
UserProfile.removeUserAttributes(attributeNames: Array<string>)

updateUserAttributes

  • ACP
ACPUserProfile.updateUserAttributes(attributeMap: { string: any })
ACPUserProfile.updateUserAttribute(attributeName: string, attributeValue: string)
UserProfile.updateUserAttributes(attributeMap: Record<string, any>)