Mobile SDK Attachment



Posted Jun 03, 2024

Hello Zendesk Community.
 

We are using the Classic Unity SDK to integrate Zendesk into our game and we have encountered difficulties with the functionality of adding attachments on the Android platform - the button to add an attachment is just missing. Everything works correctly in the browser.
Maybe someone has encountered a similar problem and can help with a solution.

Our observations:
 

In the application manifest, we need to add the following line:

<activity android:name="com.zendesk.gallery.Gallery" android:label=""/>

To open the browser and select an image for attachment, we create a Java object as follows:

AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject javaClass = new AndroidJavaObject("com.zendesk.gallery.UnityBinder");


Then we call the OpenGallery method, but we don't have information about what parameters and in what format they need to be passed. Here's an example of our call:

javaClass.CallStatic("OpenGallery", jc.GetStatic<AndroidJavaObject>("currentActivity"), <WHAT_ARGS?>);


What can we do to have a button and the ability to attach an attachment in the mobile SDK?
 

Thank you for your assistance.


0

1

1 comment

Hi Alex! I wasn't sure how to handle this, so I reached out to a team here and they provided an answer for me. I don't want to paraphrase, since this isn't an area I'm comfortable with, so I'll share exactly what they shared with me. Let me know if this helps!
 
  • General android dependencies can be found in our documentation here.

    Now for the question...
  • If the customer is using our UI, the SDK already implements an attachments button along with required functionality to open a gallery on Android. See screenshots attached for both when conversations are enabled and disabled. Do note that the attachments button will remain disabled (greyed out, see 3rd screenshot) until some text has been input in the composer.
  • If the customer prefers to implement the file picker solution on their own, they can refer to the FileBrowser class in the Plugins directory of the Zendesk SDK, specifically the OpenFileBrowser method. This is the method called by our attachment button to open the image picker.

0


Sign in to leave a comment.

Didn't find what you're looking for?

New post