Recent searches
No recent searches
Support SDK for iOS => Pre-selected attachments
Posted Nov 25, 2022
Hello there! We’re using Support SDK for iOS (and also for Android, but this topic is about iOS version). Idk, can I call this an issue, but however, when we're adding pre-selected file attachments to tickets (using the `fileAttachments` field of the `RequestUiConfiguration`) the pre-selected files attaches every time when we open a ticket screen (either if we open a new ticket, either if we open old ticket). For example: I’ve opened a ticket screen to start a new conversation, the pre-selected file is attached as expected, I’ve submitted a ticket with pre-selected file attached and everything is okay, but when I open this ticket again (for example - someone answered me) - the pre-selected file is attached again, but I’ve sent this file and don’t want to send it again.
0
16 comments
Eric Nelson
Can you replicate this issue into a simple example application so that we can take a look in an isolated environment?
Thanks!
0
Timur Dyushaliev
Hey Eric. Thanks for the response. What do you mean with "a simple example application"? Should I create a demo application (which also requires me to create a demo Zendesk Support account), build it, and then distribute it to TestFlight, so you can install and reproduce the issue? Maybe I just should create a demo project, push it to Github, and then give you a link to the repo, so you can clone the project and build it?
You can reproduce the issue easily, if you have an example app, which uses the `fileAttachments` field. I guarantee you will face the same problem.
0
Eric Nelson
I don't have an example with this pattern readily available. If you could throw demo project together that I can clone off Github would be perfect!
Thanks!
0
Timur Dyushaliev
I've created a simple demo project (also a free-trial demo account), which illustrates the problem. Can you please take a look? Thanks!
link to the repo: https://github.com/TimurDyushaliev/zendesk_support_ios_demo
0
Eric Nelson
Thanks! I've been able to reproduce and I have everything I need to get this bug prioritized. I don't have an ETA at this time, though when I have an update - I'll let you know.
1
Timur Dyushaliev
Okay. Thank you Eric. Much appreciated!
0
Eric Nelson
Thanks for your patience, the bug is still getting prioritized but we've been able to come up with a workaround for you until we can get this patched.
Using the event handler to observe the ZDKAPI_RequestSubmissionSuccess event, then removing all the view controller and pushing a new one with a config that doesn't include a file and pushing that new controller (I am not an iOS dev so there's probably a nicer way to do it). It does work and remove the file from any new response.
Hope this helps and thanks again for your patience!
0
Eric Nelson
The team has decided to not pick this work up as a bug as you're the only person we've had report this issue and we've found a workaround. Due to that we're instead going to build some documentation to talk about solution.
Thanks for your patience and let me know if you need anything!
0
Timur Dyushaliev
Why did you delete my last reply, where I explained why your workaround doesn't solve the problem (and even makes worse)? And you guys really call this "Community" after it?
0
Eric Nelson
I've checked the backend as well as our spam and moderation queue. We have no history of a reply from you after your message on December 2nd. Can you post your reply again? If you can explain why the workaround doesn't address the issue, I'll happily look into it.
Thanks,
Eric
0
Timur Dyushaliev
That's weird... I was able to see the message for about 15-30 minutes. Even when I closed the web page and opened again via a link after some short period of time. But, after several hours, when I opened the web page again, my message just disappeared. Idk the reason, but nvm, that doesn't matter now.
So.. about the workaround. I didn't try it yet, but what I see from the code:
The callback is called whenever a ticket is submitted. So, inside the callback we just close the current Zendesk support page and open it again, but without pre-selected file. I see 2 problems here:
1. This (closing and reopening) will be seeable to a user because of the animations. That sounds not good.2. Okay, the first ticket is submitted with pre-selected file. Okay, a user was able to see that the page suddenly reopened. But what about new tickets? The wanted file won't be attached to them automatically, because the reopened page will be with a new config, which doesn't include the file. We expect the file will be automatically attached to every new ticket (but not for replies), as it works on your Android SDK.
Because of these - I don't think it is a solution for us. But again.. I didn't try it yet. These are just my theoretical thoughts from what I see from the code. If I'm wrong, please let me know. I will try it in our project, but after the new year. I'm tired and took a rest from the job.
By the way. It was unpleasant to me to read that you won't fix the bug, because I'm the only one, who faced this. A problem is a problem, no matter how many people are facing it. I've even created the sample project, which illustrates the problem, so you were able to reproduce the issue and agreed there is a bug. We've been using your services for several years and paying for them. This case gives us a thought, that you won't fix problems, when we meet them.
0
Timur Dyushaliev
And also, our crashes have been growing since I implemented attaching a file automatically (as a pre-selected file) on Android.
Logs:
CellBindHelper.java line 31
zendesk.support.request.CellBindHelper.openAttachment
I wasn't able to reproduce this. Maybe it's a known issue and you know the reason? Or should I open a new post?
0
Timur Dyushaliev
Aahh.. I've got this. Now I know the reason, why my message "disappeared". Its status was "Pending approval" (as well as my current reply about the workaround) and it didn't pass. But another question raises in my mind: "Why?".
0
Eric Nelson
Hey Timur,
I could see your latest post in the moderation queue, though your initial message we still have no history of. Our system flagged your latest message due to a particular combination of characters in the comment that have been being used recently in spam. I've tuned the alert so it shouldn't happen again.
---
For the workaround your understanding of whats happening is actually a bit off. The process is happening in the background and the user isn't made aware of the swap as it happens during the request view change to place their comment into the conversation body. Additionally this function does the swap upon completion of the ticket submission. So it only affects the ticket that threw the notification. If a user wants to submit a ticket again, the attachment will be added again as anticipated.
I'd highly suggest testing this all for yourself in the demo that you provided. Though for your ease I've included a screen recording.
Lastly, I can understand why you found it unpleasant to read that we wouldn't be picking up this bug. Our team has a large list of priorities and we want to continue making improvements to the SDK's. When encountering issues such as this where we are able to find a solution to a minor problem / edge case without having to make any changes to the core service. Then we elect to provide the workaround to the customer and continue spending our time on making improvements to the SDK.
0
Eric Nelson
For your Android crash issue - It's tough to say without seeing your implementation and you being unable to replicate. I'd ask that you create a new post with a bit more information about your build as well as the SDK version that you're running.
Thanks!
0
Timur Dyushaliev
Thank you, Eric, for the explanation and for the video, which shows that the workaround solves the issue. I will try it later and let you know. But for now, the crashes on Android is more important for us and I'm working on that. If we look to the stacktrace:
we can see this function (from the "CellBindHelper" class) was called:
If I understood correctly, this function opens the file picker page. So, I think, our app crashes, because it can't in some cases pass a file's URI to the file picker page (Belvedere package) according to the docs: https://developer.android.com/reference/kotlin/android/os/FileUriExposedException
But is Belvedere another app? I mean it just opens another app (for example some system app, which serves to browse files)? If it is, I can't understand why we can't reproduce this in our side. Maybe in some devices (or maybe settings, installed apps and etc) it opens another app, and in other devices it's just a page (which is within the app scope). Or maybe it's just about some privacy settings.. idk..
I want to debug this issue inside your Android SDK code to understand completely and to try to fix it. The fact that your Android SDK repository is in jfrog, instead of usual github makes things harder to me (I wasn't able to find the repo in github). I will create a new post about this, when I collect more information and maybe come up with a fix. For now, I just think replacing "file://" prefix in URI to "content://" solves the problem, as described in docs:
0