description
Costumer is attempting to load a pdf for android using intents with webview.
in the mobile app they are using webview control for displaying the remote web site by binding a URL. The web pages in the web site contains few pdf links. On click of normal hyperlinks, respective web page is being shown in the web view. Whereas, on tapping a pdf links, a blank window is getting opened in Android devices. In iOS it’s working fine and a PDF is showing.
Per Jira WebView cannot disply PDF documents on Android. So they are using intents as a workaround to open the PDF link. The issue is that on click of the pdf link in the web view, they are unable to get the exact PDF url with any of Titanium WebView API methods or events
The customer was able to do it natively and open the PDF's with intents.
Request
The customer wants to know how to get the exact PDF link using the webview API or if there is a workaround they could use.
additional information
attached are two apps. One is a titanium app and one is an android native application.
[titanium app](
https://axwaysoftware-my.sharepoint.com/personal/vvazquezmontero_axway_com/_layouts/15/guestaccess.aspx?guestaccesstoken=rsxSxfm51VH5t8MRm7YpDX1bHDfJfDfaycmtpKrlAEE%3d&docid=2_11a957eab95234b6ab84003e12f7b0b41&rev=1)
master: https://github.com/appcelerator/titanium_mobile/pull/9459
hello [~gmathews] is there any workaround we can share with the customer at the moment there is a delivery they are trying to meet?
[~vvazquezmontero] A workaround would be to use the
blacklisturl
event to listen for PDF files.[~gmathews] Thank you. I will share with customer and update the ticket.
[~gmathews] They are still not able to see the PDF with the current work arround
steps to reproduce :
1. copy and replace the content of app.js with the attached app.js file content. 2. Run the application in android device. 3. click on “Routine Vaccines” link. 4. Try to open any PDF links in that page. Note: we are using 6.1.2.GA Ti SDK [^app (1).js]Will this fix be included in SDK 6.3.0?
[~vvazquezmontero] Try this?
[~gmathews] I just wanted to know if this was still going to be included in SDK 6.3.0 and if we had a new date for its release
[~gmathews] The second workaround didn't work for the customer either.
[~vvazquezmontero] Could you provide details regarding what happens when using the workaround?
With new workaround they are unable to load links. Specifically with this URL URL : "http://wwwnc.cdc.gov/travel/destinations/traveler/children.chronic.cruise_ship.extended_student.immune_compromised.pregnant.mission_disaster.vfr/india?s_cid=ncezid-dgmq-travel-leftnav-traveler" with previous work around they are able to access PDF links but there are some scenarios where some links open in another tab which contains PDF links in such cases they are not able to open PDF pages. Note : Please use the given url to reproduce the issue. steps to reproduce the scenario 1. copy and replace the content of app.js with the attached app.js file content. 2. Run the application in android device. 3. click on “Routine Vaccines” link. 4. Try to open any PDF links in that page. [^app.js] Using 6.1.2.GA Ti SDK
[~vvazquezmontero] This should work:
7_1_X: https://github.com/appcelerator/titanium_mobile/pull/9828
[~hknoechel] [~amukherjee] [~kiguchi] We need a parity ticket for iOS and Win
[~hknoechel] It's not an event it's a callback like
onload
onerror
onsendstream
etc... -we could make it an event, which would probably be better. Maybelink
?- Update: Just rejogged my memory and realised we can't make this an event. This must be a callback.FR Passed. Waiting for CR to pass.
Bumping to 7.4.0 to coordinate iOS and Windows implementations: - TIMOB-26063 - TIMOB-25868
PR Merged.
Verified the fix on 7.5.0.v20181024102947.Works fine.Closing