Recent searches
No recent searches
File Upload Fails Using Zendesk Chat SDK
Posted Nov 13, 2024
Hello Zendesk Support,
I am encountering an issue with file uploads in the Zendesk Chat SDK when using a custom ChatAPIConfiguration
in my app. Here are the details and steps I have taken:
-
Configuration Setup:
- I initialize
ChatAPIConfiguration
with visitor information such as name, email, and phone number retrieved from user session data. The configuration is then assigned toChat.instance?.configuration
. - File uploads do not work as expected; the
ChatAttachmentMessage
log shows alocalURL
for the file but lacks an uploadedurl
, which I assume means the upload hasn’t completed successfully.
- I initialize
-
Code Details: Below is a summary of the configuration and initialization code being used:
var chatAPIConfig: ChatAPIConfiguration { let chatAPIConfig = ChatAPIConfiguration() guard let email = session.object(forKey: "user.email") as? String, let firstName = session.object(forKey: "user.name") as? String, let lastName = session.object(forKey: "user.last_name") as? String, let phoneNumber = session.object(forKey: "user.mobile_phone") as? String else { return chatAPIConfig } chatAPIConfig.visitorInfo = VisitorInfo(name: "\(firstName) \(lastName)", email: email, phoneNumber: phoneNumber) return chatAPIConfig } func initialize() { setChatLogging(isEnabled: true, logLevel: .verbose) Chat.initialize(accountKey: accountKey) } func openZendesk() { do { initialize() Chat.instance?.configuration = chatAPIConfig let viewController = try Messaging.instance.buildUI(engines: engines, configs: []) viewController.navigationItem.title = "Live Chat" self.navigationController?.show(viewController, sender: self) } catch { self.showSimpleAlert(title: "Error", message: "Error Zendesk") } }
-
Troubleshooting Steps Taken:
- Confirmed that file uploads are enabled in Zendesk Chat settings.
- Ensured that the file size is within limits (325 KB).
- Enabled verbose logging with
Logger.isEnabled = true
andLogger.defaultLevel = .verbose
, but there are no specific error messages indicating why the file does not upload. - Tested on both the simulator and a real device to rule out environment-specific issues.
Could you provide guidance on resolving this issue or suggest additional troubleshooting steps? Thank you for your assistance!
0
0
0 comments