Сообщения Salesforce для In-App [iOS Swift SDK] Как я могу установить prechatfields и hiddenprechatfields? v1.5.2IOS

Программируем под IOS
Ответить
Гость
 Сообщения Salesforce для In-App [iOS Swift SDK] Как я могу установить prechatfields и hiddenprechatfields? v1.5.2

Сообщение Гость »

openchat < /h1>

Код: Выделить всё

let preChatValue = "myValue"
let preChatKey = "Somename"
let config = UIConfiguration(serviceAPI: serviceAPIURL,
organizationId: organizationId,
developerName: developerName,
conversationId: conversationId)

let coreClient = CoreFactory.create(withConfig: config)

let myPreChatDelegate = HiddenPrechatDelegateImplementation(preChatValue: preChatValue, preChatKey: preChatKey)
coreClient.preChatDelegate = myPreChatDelegate
// Need to add some code to add preChatField with name(preChatKey) and value (preChatValue)

< /code>
 hiddenprechatdelegateimplementation < /h1>
import Foundation
import SMIClientCore // Import the Salesforce SDK; you need to confirm the correct module name.

class HiddenPrechatDelegateImplementation: HiddenPreChatDelegate {

var preChatValue: String
var preChatKey: String

init(preChatValue: String, preChatKey: String) {
self.preChatValue = preChatValue
self.preChatKey = preChatKey
}

func core(_ core: CoreClient,
conversation: Conversation,
didRequestPrechatValues hiddenPreChatFields: [HiddenPreChatField],
completionHandler: HiddenPreChatValueCompletion) {

// Use the conversation object to inspect info about the conversation

// Pass pre-chat fields back to SDK
completionHandler(hiddenPreChatFields)
}

}
Docs: https://developer.salesforce.com/docs/s ... a-pre-chat -form
Repo: https://github.com/salesforce-async-messaging
Я попытался установить поле PreChat из Swift Code (iOS Swift)

Подробнее здесь: https://stackoverflow.com/questions/783 ... elds-and-h
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «IOS»