최근 검색
최근 검색 없음

Neil Hannah
가입한 날짜: 2021년 11월 30일
·
마지막 활동: 2022년 1월 11일
팔로잉
0
팔로워
0
총 활동 수
4
투표 수
0
가입 플랜
1
활동 개요
배지
문서
게시물
커뮤니티 댓글
문서 댓글
활동 개요
님의 최근 활동 Neil Hannah
Neil Hannah님이 에 댓글을 입력함
Hi,
As I initially found a workaround it took me a bit to get back to this, but using the example, which is in swift instead of ObjC, I find the exact same issue. I actually found another issue as well where setting department also caused message sending issues. So to reiterate, if the name is set to hidden, and not given, FAIL, if name required, and given, FAIL, if department given FAIL. Here is the sample code in a failed state... comment out the `.department` and swap the commented `visitorInfoTest` for the uncommented one and you will find another failure. You can paste this into your ZendeskMessaging file in the sample project, it has very few changes from that.
//
// ZendeskMessaging.swift
// UnifiedSDK
//
// Created by Zendesk on 17/04/2020.
// Copyright © 2020 Zendesk. All rights reserved.
//
import Foundation
import MessagingSDK
import MessagingAPI
import CommonUISDK
import ChatSDK
import ChatProvidersSDK
final class ZendeskMessaging: NSObject, JWTAuthenticator {
static let instance = ZendeskMessaging()
static var themeColor: UIColor? {
didSet {
guard let themeColor = themeColor else { return }
CommonTheme.currentTheme.primaryColor = themeColor
}
}
#warning("Please provide Chat account key")
let accountKey = ""
var authToken: String = "" {
didSet {
guard !authToken.isEmpty else {
resetVisitorIdentity()
return
}
Chat.instance?.setIdentity(authenticator: self)
}
}
// MARK: Configurations
var messagingConfiguration: MessagingConfiguration {
let messagingConfiguration = MessagingConfiguration()
messagingConfiguration.name = "Chat Bot"
return messagingConfiguration
}
var chatConfiguration: ChatConfiguration {
let chatConfiguration = ChatConfiguration()
chatConfiguration.isAgentAvailabilityEnabled = true
chatConfiguration.isPreChatFormEnabled = true
chatConfiguration.preChatFormConfiguration.name = FormFieldStatus.required
chatConfiguration.preChatFormConfiguration.email = FormFieldStatus.required
chatConfiguration.preChatFormConfiguration.phoneNumber = FormFieldStatus.required
chatConfiguration.preChatFormConfiguration.department = FormFieldStatus.hidden
return chatConfiguration
}
var chatAPIConfig: ChatAPIConfiguration {
let chatAPIConfig = ChatAPIConfiguration()
chatAPIConfig.tags = ["iOS", "chat_v2"]
chatAPIConfig.department = "Neil test" // This line commented out will work
let visitorInfoTest = VisitorInfo(email: "neil@gmail.com", phoneNumber: "1111111111")
// let visitorInfoTest = VisitorInfo(name: "Neil Test", email: "neil@gmail.com", phoneNumber: "8607489943") // This line replacing one above it causes app not to work
chatAPIConfig.visitorInfo = visitorInfoTest
return chatAPIConfig
}
// MARK: Chat
func initialize() {
setChatLogging(isEnabled: true, logLevel: .verbose)
Chat.initialize(accountKey: accountKey, appId: "")
}
func setChatLogging(isEnabled: Bool, logLevel: LogLevel) {
Logger.isEnabled = isEnabled
Logger.defaultLevel = logLevel
}
func resetVisitorIdentity() {
Chat.instance?.resetIdentity(nil)
}
func getToken(_ completion: @escaping (String?, Error?) -> Void) {
completion(authToken, nil)
}
// MARK: View Controller
func buildMessagingViewController() throws -> UIViewController {
Chat.instance?.configuration = chatAPIConfig
return try Messaging.instance.buildUI(engines: engines,
configs: [messagingConfiguration, chatConfiguration])
}
}
extension ZendeskMessaging {
// MARK: Engines
var engines: [Engine] {
let engineTypes: [Engine.Type] = [ChatEngine.self]
return engines(from: engineTypes)
}
func engines(from engineTypes: [Engine.Type]) -> [Engine] {
engineTypes.compactMap { type -> Engine? in
switch type {
case is ChatEngine.Type:
return try? ChatEngine.engine()
default:
fatalError("Unhandled engine of type: \(type)")
}
}
}
}
댓글 보기 · 2022년 1월 11일에 게시됨 · Neil Hannah
0
팔로워
0
투표 수
0
댓글
Neil Hannah님이 에 댓글을 입력함
Hi Greg, I will try to sum it up here.
Working:
`config.visitorInfo = [[ZDKVisitorInfo alloc] initWithName:nil email:@"neil@test.com"phoneNumber:@"1234567890"];`
댓글 보기 · 2021년 12월 02일에 게시됨 · Neil Hannah
0
팔로워
0
투표 수
0
댓글
Neil Hannah님이 에 게시물을 만듦
As of 2 days ago trying to set initWithName on ZDKVisitorInfo causes the chat not to work. The same issue is present if ZDKChatFormConfiguration is set with initWithName ZDKFormFieldHidden. Chat works fine with name set to NULL and the field required or optional in the form, but if the name is given, it does not connect to the chat. Also if the name is not given and the field in the form set to ZDKFormFieldHidden it also no longer connects. This started 2 days ago in prod apps and I suspect it's an issue in either the SDK or server. I cannot find actual support so posting here.
2021년 11월 30일에 게시됨 · Neil Hannah
0
팔로워
2
투표 수
4
댓글