Question


Infosys Ltd
US
Last activity: 15 Feb 2018 16:09 EST
Custom Android Mobile App can't download PDFs and files
Hello,
I created a custom android app in 7.2. When I try to download a file in the app, it does nothing.
When I use the Pega's URL and a mobile browser, it will download the file into the local storage.
Currently, the files are stored in Azure. In a section, a script run while passing the URL from a report definition in order to download.
I tried to make a model dialog appear with the PDF's URL in either a iframe, embed or object. The model dialog appears blank, but I can save the file by right clicking.
Is there a way for my custom android app to either download or view files?
Thanks
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution


Pegasystems Inc.
IN
You can use DocumentViewer API of Pega mobile client to download or view files on custom mobile app. Here's the documentation - https://community.pega.com/sites/default/files/mobileclient/690/api/client_api/container_doc_viewer_open.html


Infosys Ltd
US
I just noticed that when I try to open the model dialog with Pega's URL and a mobile browser, it says "This plugin is not supported." I am not sure if this is relevant or not.


Pegasystems Inc.
US
Does this thread help you? https://collaborate.pega.com/question/not-able-download-attachments-pdf-mobile-android


Infosys Ltd
US
It seems like this link is about using a URL in a mobile browser, while my issue is about a custom mobile.
I am not sure, but it also seems like the fix that people are responding with "doAttachmentSingleClick" works for files in Rule-File-Binary rule. My files are in Microsoft Azure. If I am wrong please tell me and maybe steps on how to use "doAttachmentSingleClick" with URLs.
Thanks


Pegasystems Inc.
US
Does this help at all in your case?
https://docs-previous.pega.com/making-pdf-file-available-offline-viewing


Infosys Ltd
US
Unfortunately, this article is helpful if the PDF was uploaded to a Rule-File-Binary rule. In my case, the files are uploaded in Microsoft Azure and a report definition will get the URL. If there is a way for me to modify the steps so that it will accept URL please tell me.
Thanks
Accepted Solution


Pegasystems Inc.
IN
You can use DocumentViewer API of Pega mobile client to download or view files on custom mobile app. Here's the documentation - https://community.pega.com/sites/default/files/mobileclient/690/api/client_api/container_doc_viewer_open.html


Infosys Ltd
US
Thanks, this helped a lot! Unfortunately, this method does not work for browsers and URL. I need to somehow check if the files are being access by browsers or the custom app.


Pegasystems Inc.
US
If you are loading the PDFs by URL, and adding them to the custom application cache manifest, then maybe you could add a query string "?from=app" to identify the items loading through the app, then use that however you want. Just a thought