Upgrading from older SDK versions to 6.0

This guide will help current users of older versions of the SDK to upgrade to the new SDK 6.0 and upwards.

How to upgrade?

Before you start:

  • Before SDK 6.0, there was a dependency between Xcode, Swift version, and SDK version. That forced customers to upgrade their Xcode or Swift version, this version unlocks this dependency.
  • The class LPMessagingSDK has been renamed LPMessaging.
Step 1

Rename LPMessagingSDK to LPMessaging.

Remove of all import statements such as import LPInfra, import LPAMS, import LPMonitoring; only keep import LPMessagingSDK.

Step 2

Replace any class/facade function calls to the new LPMessaging class. Examples:

LPAMSFacade.getUnreadMessagesCount()

is now

LPMessaging.instance.getUnreadMessagesCount()
LPInfraFacade.getUnreadMessagesCount()

is now

LPMessaging.instance.getUnreadMessagesCount()
LPMonitoring.sendSDEWithConsumerID()

is now

LPMessaging.instance.sendSDEWithConsumerID()
Step 3

If you are using the Logging Module please refer to our logging documentation.

Example of changes in this model:

Setting up the log level is now

LPMessaging.instance.setLoggingLevel(level: .TRACE)

The old way of subscribing to received logs from the LivePerson Messaging SDK:

LPMessagingSDK.instance.subscribeLogEvents(.trace)

is now

LPMessaging.instance.getLogSnapshot(level: LPLoggingLevel) -> [String]
LPMessaging.instance.getLogStringBlock(level: LPLoggingLevel) -> String