Recent searches


No recent searches

Timur Dyushaliev's Avatar

Timur Dyushaliev

Joined Oct 16, 2021

·

Last activity Jan 12, 2023

Following

0

Followers

0

Total activity

15

Vote

1

Subscriptions

2

ACTIVITY OVERVIEW

Latest activity by Timur Dyushaliev

Timur Dyushaliev commented,

Community comment Developer - Zendesk SDKs

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:

       at android.os.StrictMode.onFileUriExposed(StrictMode.java:2141)
     at android.net.Uri.checkFileUriExposed(Uri.java:2391)
     at android.content.Intent.prepareToLeaveProcess(Intent.java:11848)
     at android.content.Intent.prepareToLeaveProcess(Intent.java:11797)
     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1722)
     at android.app.Activity.startActivityForResult(Activity.java:5377)
     at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java)
     at android.app.Activity.startActivityForResult(Activity.java:5335)
     at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java)
     at android.app.Activity.startActivity(Activity.java:5721)
     at android.app.Activity.startActivity(Activity.java:5674)
     at zendesk.support.request.CellBindHelper.openAttachment(CellBindHelper.java:31)
     at zendesk.support.request.CellBindHelper.access$000(CellBindHelper.java)
     at zendesk.support.request.CellBindHelper$1.onClick(CellBindHelper.java:8)
   ...

we can see this function (from the "CellBindHelper" class) was called:

private void openAttachment(Context context, StateRequestAttachment requestAttachment) {
  final Intent intent = Belvedere.from(context)
          .getViewIntent(requestAttachment.getParsedLocalUri(), requestAttachment.getMimeType());
  final PackageManager manager = context.getPackageManager();
  if (manager.queryIntentActivities(intent, 0).size() > 0) {
      context.startActivity(intent);
  }
}

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

 The exception that is thrown when an application exposes a file:// android.net.Uri to another app.

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:

Instead, apps should use content:// Uris so the platform can extend temporary permission for the receiving app to access the resource.

View comment · Edited Jan 12, 2023 · Timur Dyushaliev

0

Followers

0

Votes

0

Comments


Timur Dyushaliev commented,

Community comment Developer - Zendesk SDKs

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?".

View comment · Posted Dec 28, 2022 · Timur Dyushaliev

0

Followers

0

Votes

0

Comments


Timur Dyushaliev commented,

Community comment Developer - Zendesk SDKs

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


Fatal Exception: android.os.FileUriExposedException: file:{path_to_file_here} exposed beyond app through Intent.getData()
       at android.os.StrictMode.onFileUriExposed(StrictMode.java:2141)
       at android.net.Uri.checkFileUriExposed(Uri.java:2391)
       at android.content.Intent.prepareToLeaveProcess(Intent.java:11179)
       at android.content.Intent.prepareToLeaveProcess(Intent.java:11128)
       at android.app.Instrumentation.execStartActivity(Instrumentation.java:1724)
       at android.app.Activity.startActivityForResult(Activity.java:5444)
       at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java)
       at android.app.Activity.startActivityForResult(Activity.java:5395)
       at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java)
       at android.app.Activity.startActivity(Activity.java:5795)
       at android.app.Activity.startActivity(Activity.java:5748)
       at zendesk.support.request.CellBindHelper.openAttachment(CellBindHelper.java:31)
       at zendesk.support.request.CellBindHelper.access$000(CellBindHelper.java)
       at zendesk.support.request.CellBindHelper$1.onClick(CellBindHelper.java:8)
       at android.view.View.performClick(View.java:7507)
       at android.view.View.performClickInternal(View.java:7484)
       at android.view.View.access$3600(View.java:839)
       at android.view.View$PerformClick.run(View.java:28689)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:236)
       at android.app.ActivityThread.main(ActivityThread.java:8037)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)

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?

View comment · Posted Dec 28, 2022 · Timur Dyushaliev

0

Followers

0

Votes

0

Comments


Timur Dyushaliev commented,

Community comment Developer - Zendesk SDKs

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:

@objc private func submitRequestCompleted(notification: NSNotification){
let helpCenter = HelpCenterUi.buildHelpCenterOverviewUi(withConfigs: [])
self.navigationController?.popToRootViewController(animated: true)
self.navigationController?.pushViewController(helpCenter, animated: true)
}


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.

View comment · Posted Dec 28, 2022 · Timur Dyushaliev

0

Followers

0

Votes

0

Comments


Timur Dyushaliev commented,

Community comment Developer - Zendesk SDKs

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? 

View comment · Posted Dec 27, 2022 · Timur Dyushaliev

0

Followers

0

Votes

0

Comments


Timur Dyushaliev commented,

Community comment Developer - Zendesk SDKs

Okay. Thank you Eric. Much appreciated!

View comment · Posted Dec 02, 2022 · Timur Dyushaliev

0

Followers

0

Votes

0

Comments


Timur Dyushaliev commented,

Community comment Developer - Zendesk SDKs

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

View comment · Posted Dec 02, 2022 · Timur Dyushaliev

0

Followers

0

Votes

0

Comments


Timur Dyushaliev commented,

Community comment Developer - Zendesk SDKs

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.

View comment · Posted Dec 01, 2022 · Timur Dyushaliev

0

Followers

0

Votes

0

Comments


Timur Dyushaliev created a post,

Post Developer - Zendesk SDKs

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. 


On the Android SDK, it works different (how we want). The pre-selected file is attached only if I open a new ticket (only to the first message). When I open old ticket, the pre-selected file isn’t attached. It sounds for us logically - We want to attach pre-selected files only to new tickets and only once (with the first message).
 
We’re using the latest versions of the SDKs (Android 5.1.0; iOS 6.0.0).

Edited Nov 25, 2022 · Timur Dyushaliev

0

Followers

2

Votes

16

Comments


Timur Dyushaliev commented,

Community comment Developer - Zendesk SDKs

In iOS configuring "Request" with tags to only HelpCenterUI works very well.

View comment · Posted Sep 02, 2021 · Timur Dyushaliev

0

Followers

0

Votes

0

Comments