在 Swift 从 Watson Customer Engagement 获取渠道和用户 ID

Get Channel and User ID from Watson Customer Engagement on Swift

我想从Watson平台上注册MCE SDK获取Channel和User Id。我能够使用以下代码获取有关 Android 的信息:

RegistrationClient client = MceSdk.getRegistrationClient();
RegistrationDetails details = client.getRegistrationDetails(this);

String channelID = registrationDetails.getChannelId();
String userID = registrationDetails.getUserId();

有谁知道如何在iOS端获取SDK的相同信息?我尝试了不同的方法,我唯一能得到的细节是 SDK 版本和应用密钥:

let sdkVersion = MCESdk.shared.sdkVersion()
let appKey = MCESdk.shared.config.appKey

最后,我看错了对象,所有详细信息都在 class MCERegistrationDetails 上。

let appKey = MCERegistrationDetails.shared.appKey
let channelId = MCERegistrationDetails.shared.channelId
let userId = MCERegistrationDetails.shared.userId