Migrate to Adobe Experience Platform 5.x SDKs for iOS
data-variant=info
data-slots=text
SDK versions
Migrate from Adobe Experience Platform 4.x SDKs for iOS
If you have implemented Adobe Experience Platform 4.x SDKs for iOS, then this guide will help you understand the steps required to migrate your implementation to the Experience Platform 5.x SDKs. In summary, you'll need to:
Update dependencies
Manual library import
If you are importing SDK libraries manually, make sure to update your libraries by downloading the most recent 5.x binaries from their respective Github repositories.
CocoaPods
If you are using CocoaPods to manage your Adobe Experience Platform Mobile SDK dependencies, the following example shows you how to update to Experience Platform 5.x SDKs in your Podfile.
# Update pod dependencies to 5.x version
# pod 'AEPCore', '~> 4.0'
# pod 'AEPLifecycle', '~> 4.0'
# pod 'AEPIdentity', '~> 4.0'
# pod 'AEPSignal', '~> 4.0'
# pod 'AEPUserProfile', '~> 4.0'
pod 'AEPCore', '~> 5.0'
pod 'AEPLifecycle', '~> 5.0'
pod 'AEPIdentity', '~> 5.0'
pod 'AEPSignal', '~> 5.0'
pod 'AEPUserProfile', '~> 5.0'
Save the Podfile, and run pod repo update to update your local CocoaPods repository.
Once the previous command is complete, run pod install or pod update to update the application dependencies.
Swift Package Manager
If you are using Swift Package Manger (SPM) for managing your app dependencies, you can now include the Experience Platform 5.x SDKs either through Xcode UI, or by declaring them as dependencies in the Package.swift project file. For more details, follow the guide for managing dependencies using Swift Package Manager.
Handle API migration and breaking changes
When updating to the Experience Platform 5.x SDKs, please take note of the following updates for API references.
Edge Bridge
As of version 5.0.0 of the Adobe Experience Platform Edge Bridge for iOS, the table below shows how the trackAction and trackState parameters map to the data node of the Experience Event sent to the Experience Platform Edge Network. Edge Network automatically maps these data variables to Adobe Analytics without additional server-side configuration. If you are using Edge Bridge version 4.x and mapping data to XDM in your datastream, adjustments are required for version 5.0.0.
data.actiondata.__adobe.analytics.linkNamedata.__adobe.analytics.linkType with value other is also automatically included.data.statedata.__adobe.analytics.pageNamedata.contextdatadata.__adobe.analytics.contextDatatrackAction and trackState API calls.data.contextdatadata.__adobe.analytics&&products is sent as data.__adobe.analytics.products. Please note that these keys must be known to Analytics and are case sensitive. Find the full list of supported Analytics variables here.data.__adobe.analytics.contextData.a.AppIDa.AppID.data.__adobe.analytics.cpforeground or background.Track action example
Given the track action call:
MobileCore.track(action: "action name", data: ["key": "value", "&&products": ";Running Shoes;1;69.95;event1|event2=55.99;eVar1=12345"])
The resulting Experience Event has the following payload:
{
"data":{
"__adobe": {
"analytics": {
"linkName": "action name",
"linkType": "other",
"cp": "foreground",
"products": ";Running Shoes;1;69.95;event1|event2=55.99;eVar1=12345",
"contextData":{
"a.AppID": "myApp 1.0 (1)",
"key": "value"
}
}
}
}
}
Track state example
Given the track state call:
MobileCore.track(state: "view name", data: ["&&events": "event5,event2=2"])
The resulting Experience Event has the following payload:
{
"data":{
"__adobe": {
"analytics": {
"pageName": "view name",
"cp": "foreground",
"events": "event5,event2=2",
"contextData":{
"a.AppID": "myApp 1.0 (1)"
}
}
}
}
}
Messaging
Push tracking
In order to provide more control over URL handling from UNNotificationResponse objects, two old APIs were removed and a new one was added.
handleNotificationResponse(_:applicationOpened:withCustomActionId:)handleNotificationResponse(_:urlHandler:closure:)handleNotificationResponse(_:closure:)handleNotificationResponse(_:urlHandler:closure:)For examples see handleNotificationResponse.
Optimize
The Proposition class has been renamed to OptimizeProposition. All references should be updated accordingly.