iOS
What to change in your app when moving the IMS iOS SDK from 1.29.x to 2.0.x.
Migration Guide (iOS 1.29.x → 2.0.x)
3
4
Logging in a user
// Before
let identity = Identity(apiKey: apiKey, externalReferenceID: userId)
identity.setIdentity { result in
switch result {
case .success:
break
case .failure(let error):
break
}
}// After (use the `Identity` shape from "Identity — drop apiKey" below)
let identity = Identity(externalReferenceID: userId)
let result = await identity.setIdentity()
switch result {
case .success:
break
case .failure(let error):
break
}// On app launch, before any IMS API calls
if SDKConfig.shared.identity == nil, isUserLoggedInToIms {
let identity = Identity(externalReferenceID: userIdForIms)
let result = await identity.setIdentity()
switch result {
case .success:
break
case .failure:
// User is not signed in to the SDK. Skip IMS calls this session.
return
}
}See also — new in 2.0.x (no migration required)
Last updated