Recent searches
No recent searches
Connection error chat SDK - iOS/Flutter
Posted Dec 21, 2020
Hi!
I am developing an integration with the chat SDK but messages are never sent. The curious thing is that when I send a media file, be it a document or photos, the media file is sent and then immediately the other messages that were in the queue are also sent.
Nothing appers in the log and sometimes the error "Connection Failed" with a button Try again appears.
This error appear only on iOS.
I've checked the appId and the AccountKey, they're correct.
I have internet connection
I'm sending screenshots showing the issue.
Xcode version: Version 12.0.1 (12A7300)
Swift 4.
My code:
Chat.initialize(accountKey: "KEY_ACCOUNT", appId: "MY_APP_ID")
func buildUI() throws -> UIViewController {
CommonTheme.currentTheme.primaryColor = .black
let chatConfiguration = ChatConfiguration()
chatConfiguration.isAgentAvailabilityEnabled = true
chatConfiguration.isPreChatFormEnabled = false
let chatAPIConfiguration = ChatAPIConfiguration()
chatAPIConfiguration.department = "Tech"
chatAPIConfiguration.visitorInfo = VisitorInfo(name: "Robson Cardozo", email: "myemail@email.com", phoneNumber: "+5562000000")
Chat.instance?.configuration = chatAPIConfiguration
// Build view controller
let chatEngine = try ChatEngine.engine()
return try Messaging.instance.buildUI(engines: [chatEngine], configs: [chatConfiguration])
}
private func startChat(result: FlutterResult, controller: FlutterViewController) throws {
let viewController = try buildUI()
let button = UIBarButtonItem(title: "Fechar", style: .done, target: self, action: #selector(dismiss))
viewController.navigationItem.leftBarButtonItem = button
viewController.navigationItem.title = "Ajuda"
let chatController = UINavigationController(rootViewController: viewController)
controller.present(chatController, animated: true)
}
When i send a text message:
When i send a media.
0
15
15 comments
Greg Katechis
Hi @...! It looks like you're utilizing a Flutter plugin, which we do not make ourselves. I would recommend reaching out to the dev team responsible for that to see if they're seeing any similar issues, as this is not something that I can replicate in a sample app.
0
Cancelled Mohamed T. Ibrahim
Hey @... I am facing the same problem with implementing the native unfied sdk
0
Greg Katechis
Hi Mohamed...are you using Flutter as well? Are you able to reproduce this in the above sample app?
0
Renata Oliveira
Hi @..., same issue here (I am using native iOS implementation)
Xcode: Version 12.0.1
Swift 4 (but I tried with Swift 5).
Can you help us?
[EDIT] I'm using this doc> https://developer.zendesk.com/embeddables/docs/chat-sdk-v-2-for-ios/getting_started#starting-a-chat
[EDIT] My code:
0
Greg Katechis
Hi Renata! Just to make sure that I understand, you're seeing this error and the message is not being sent? Or is the message sent successfully, but you still see the error?
0
Renata Oliveira
Hello @..., I saw the error when I sent text message first (status pending).
When I sent a image or other file first, all the queued messages are sent with success.
0
Renata Oliveira
Hey @..., can you help us?
0
Greg Katechis
Hi Renata, apologies for the delay. It looks like our engineering team may have found the root of this issue and they are currently investigating this. When we have an update, I will drop a line in here.
0
Renata Oliveira
@... Hey Greg, thank you, I will wait for you.
0
Greg Katechis
Hi again! I heard back from our engineering team and this is what they shared with us:
That team has opened two investigations as a result...one to provide better error handling in this situation and another to determine if this was something that we would allow in the future. For now, just ensure that the mime-type matches the file and you'll be in good shape!
0
Renata Oliveira
Hi @Greg - Community Manager,
Thank you for your reply, but our problem is different that problem about mime-types, I guess.
Our problem is:
When I send any text message first, my message status is "Pending" (it doesn't sent). But, if I sent any image/file after the firsts text messages, all messages are sent (texts and images/files). Can you see the difference? Sounds like a: "the file forces the SDK sent all pending messages, including texts messages".
(If I send only text messages, it doesn't are sent - they be pending status).
Can you help us about specifically this problem?
Thank you
0
Greg Katechis
Hi Renata, apologies for my misunderstanding. It sounds to me like the issue here is that the chat session hasn't fully connected yet, although I would expect it to send once the session has been connected. Which to me sounds like the attachment is what ends up connecting the session somehow.
Could you try to reproduce this in our sample app and if the issue does present itself in there, please share any relevant logs?
0
Renata Oliveira
Hi @...
No worries :)
Of course, where I find this app sample?
But, I show you my log and screenshots (please, see my code below - https://support.zendesk.com/hc/en-us/community/posts/1500000092482/comments/1260802781490):
Image 1: Before file sent:

Image 2: after file sent
LOG:
0
Renata Oliveira
@... any updates?
0
Mick O'Donnell
Hi Renata Oliveira - Sorry for the delayed reply, but if it's still useful to you, the demo iOS app for Chat SDK v2 can be found here. We've also added file and image upload support to our more recent Zendesk SDKs for messaging, you can check these out here.
0