{ "id": "169766", "key": "TIMOB-25277", "fields": { "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "20238", "description": "", "name": "Release 7.5.0", "archived": false, "released": true, "releaseDate": "2018-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-10-24T00:40:37.000+0000", "created": "2017-09-13T17:42:08.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [ { "id": "56551", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "171694", "key": "TIMOB-26063", "fields": { "summary": "iOS: Implement WebView.onlink callback", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } }, { "id": "56388", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "171326", "key": "TIMOB-25868", "fields": { "summary": "Windows: Implement WebView.onlink callback", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-10-24T22:03:13.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h5. description\r\nCostumer is attempting to load a pdf for android using intents with webview. \r\nin 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.\r\n\r\nPer 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\r\n\r\nThe customer was able to do it natively and open the PDF's with intents. \r\n\r\nh5. Request\r\nThe customer wants to know how to get the exact PDF link using the webview API or if there is a workaround they could use.\r\n\r\nh5. additional information \r\nattached are two apps. One is a titanium app and one is an android native application.\r\n[titanium app|https://axwaysoftware-my.sharepoint.com/personal/vvazquezmontero_axway_com/_layouts/15/guestaccess.aspx?guestaccesstoken=rsxSxfm51VH5t8MRm7YpDX1bHDfJfDfaycmtpKrlAEE%3d&docid=2_11a957eab95234b6ab84003e12f7b0b41&rev=1]", "attachment": [ { "id": "63477", "filename": "app.js", "author": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-10-25T21:58:15.000+0000", "size": 826, "mimeType": "text/javascript" }, { "id": "63384", "filename": "app (1).js", "author": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-10-03T20:42:04.000+0000", "size": 826, "mimeType": "text/javascript" }, { "id": "63254", "filename": "MyApplication_Android.zip", "author": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-09-13T17:39:42.000+0000", "size": 947392, "mimeType": "application/zip" } ], "flagged": false, "summary": "get the exact PDF url from Titanium WebView API", "creator": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 978, "state": "closed", "name": "2017 Sprint 25 SDK", "startDate": "2017-12-03T23:22:15.144Z", "endDate": "2017-12-17T23:22:00.000Z", "completeDate": "2017-12-18T22:32:02.770Z", "originBoardId": 114 }, { "id": 963, "state": "closed", "name": "2017 Sprint 22 SDK", "startDate": "2017-10-22T21:43:59.523Z", "endDate": "2017-11-05T22:43:00.000Z", "completeDate": "2017-11-06T16:33:42.425Z", "originBoardId": 114 }, { "id": 948, "state": "closed", "name": "2017 Sprint 19 SDK", "startDate": "2017-09-10T21:24:51.562Z", "endDate": "2017-09-24T21:24:00.000Z", "completeDate": "2017-09-25T17:49:27.460Z", "originBoardId": 114 }, { "id": 997, "state": "closed", "name": "2018 Sprint 03 SDK", "startDate": "2018-01-28T16:23:12.178Z", "endDate": "2018-02-11T16:23:00.000Z", "completeDate": "2018-02-12T04:22:49.354Z", "originBoardId": 114 }, { "id": 951, "state": "closed", "name": "2017 Sprint 20 SDK", "startDate": "2017-09-24T17:50:18.277Z", "endDate": "2017-10-08T17:50:00.000Z", "completeDate": "2017-10-09T20:38:07.840Z", "originBoardId": 114 }, { "id": 968, "state": "closed", "name": "2017 Sprint 23 SDK", "startDate": "2017-11-05T16:37:25.071Z", "endDate": "2017-11-19T16:37:00.000Z", "completeDate": "2017-11-20T18:57:56.565Z", "originBoardId": 114 }, { "id": 984, "state": "closed", "name": "2017 Sprint 26 SDK", "startDate": "2017-12-17T22:34:59.726Z", "endDate": "2017-12-31T22:34:00.000Z", "completeDate": "2018-01-02T16:57:05.655Z", "originBoardId": 114 }, { "id": 985, "state": "closed", "name": "2018 Sprint 01 SDK", "startDate": "2017-12-31T16:58:54.631Z", "endDate": "2018-01-14T16:58:00.000Z", "completeDate": "2018-01-17T22:44:27.028Z", "originBoardId": 114 }, { "id": 990, "state": "closed", "name": "2018 Sprint 02 SDK", "startDate": "2018-01-14T22:48:43.544Z", "endDate": "2018-01-28T22:48:00.000Z", "completeDate": "2018-01-29T16:22:42.911Z", "originBoardId": 114 }, { "id": 959, "state": "closed", "name": "2017 Sprint 21 SDK", "startDate": "2017-10-08T20:38:15.130Z", "endDate": "2017-10-22T20:38:00.000Z", "completeDate": "2017-10-24T23:55:56.605Z", "originBoardId": 114 }, { "id": 975, "state": "closed", "name": "2017 Sprint 24 SDK", "startDate": "2017-11-19T18:59:24.352Z", "endDate": "2017-12-03T18:59:00.000Z", "completeDate": "2017-12-04T23:20:14.151Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "428173", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/9459", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-09-20T17:47:46.000+0000", "updated": "2017-09-20T17:47:46.000+0000" }, { "id": "428174", "author": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "hello [~gmathews] is there any workaround we can share with the customer at the moment there is a delivery they are trying to meet? ", "updateAuthor": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-09-20T17:51:57.000+0000", "updated": "2017-09-20T17:51:57.000+0000" }, { "id": "428179", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~vvazquezmontero] A workaround would be to use the {{blacklisturl}} event to listen for PDF files.\r\n\r\n{code:js}\r\nvar window = Ti.UI.createWindow(),\r\n webView = Ti.UI.createWebView({\r\n\t url: 'https://india.gov.in/website-ministry-commerce-and-industry',\r\n });\r\n\r\nwebView.onCreateWindow = function(e) {\r\n var newWebView = Ti.UI.createWebView({\r\n blacklistedURLs: ['.pdf']\r\n }),\r\n newWin = Ti.UI.createWindow();\r\n newWebView.addEventListener('blacklisturl', function(e) {\r\n newWin.close();\r\n alert('PDF: ' + e.url);\r\n // create intent here\r\n });\r\n newWin.add(newWebView);\r\n newWin.open();\r\n return newWebView;\r\n};\r\n\r\nwindow.add(webView);\r\nwindow.open();\r\n{code}", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-09-20T18:14:03.000+0000", "updated": "2017-09-20T18:14:03.000+0000" }, { "id": "428182", "author": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~gmathews] Thank you. I will share with customer and update the ticket.", "updateAuthor": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-09-20T19:01:38.000+0000", "updated": "2017-09-20T19:01:38.000+0000" }, { "id": "428676", "author": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~gmathews] They are still not able to see the PDF with the current work arround \r\nh5. steps to reproduce : \r\n\r\n1. copy and replace the content of app.js with the attached app.js file content.\r\n2. Run the application in android device.\r\n3. click on “Routine Vaccines” link.\r\n4. Try to open any PDF links in that page.\r\n\r\nNote: we are using 6.1.2.GA Ti SDK\r\n [^app (1).js] ", "updateAuthor": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-10-03T20:42:08.000+0000", "updated": "2017-10-03T20:42:08.000+0000" }, { "id": "428677", "author": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Will this fix be included in SDK 6.3.0?\r\n", "updateAuthor": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-10-03T20:42:22.000+0000", "updated": "2017-10-03T20:42:22.000+0000" }, { "id": "428719", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~vvazquezmontero] Try this?\r\n\r\n{code:js}\r\nvar window = Ti.UI.createWindow(),\r\n webView = Ti.UI.createWebView({\r\n url : 'https://india.gov.in/website-ministry-commerce-and-industry'\r\n }),\r\n mainActivity = Ti.Android.currentActivity;\r\n\r\nwebView.onCreateWindow = function(e) {\r\n var newWebView = Ti.UI.createWebView({\r\n blacklistedURLs: ['.pdf']\r\n }),\r\n newWin = Ti.UI.createWindow();\r\n\r\n newWebView.addEventListener('blacklisturl', function(e) {\r\n newWin.close();\r\n mainActivity.startActivity(Ti.Android.createIntent({\r\n action : Ti.Android.ACTION_VIEW,\r\n type : 'application/pdf',\r\n data : e.url\r\n }));\r\n });\r\n\r\n newWin.add(newWebView);\r\n newWin.open();\r\n\r\n return newWebView;\r\n};\r\n\r\nwindow.add(webView);\r\nwindow.open();\r\n{code}", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-10-05T00:35:21.000+0000", "updated": "2017-10-05T00:35:21.000+0000" }, { "id": "429587", "author": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~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", "updateAuthor": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-10-25T20:30:47.000+0000", "updated": "2017-10-25T20:30:47.000+0000" }, { "id": "429601", "author": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~gmathews] The second workaround didn't work for the customer either. ", "updateAuthor": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-10-25T21:37:16.000+0000", "updated": "2017-10-25T21:37:16.000+0000" }, { "id": "429605", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~vvazquezmontero] Could you provide details regarding what happens when using the workaround?", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-10-25T21:49:11.000+0000", "updated": "2017-10-25T21:49:11.000+0000" }, { "id": "429609", "author": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "\r\nWith new workaround they are unable to load links. Specifically with this URL \r\n\r\nURL : \r\n\"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\"\r\n\r\nwith 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.\r\nNote : Please use the given url to reproduce the issue.\r\n\r\nsteps to reproduce the scenario\r\n\r\n1. copy and replace the content of app.js with the attached app.js file content.\r\n2. Run the application in android device.\r\n3. click on “Routine Vaccines” link.\r\n4. Try to open any PDF links in that page.\r\n [^app.js] \r\n\r\nUsing 6.1.2.GA Ti SDK", "updateAuthor": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-10-25T21:58:42.000+0000", "updated": "2017-10-25T21:58:42.000+0000" }, { "id": "429900", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~vvazquezmontero] This should work:\r\n\r\n{code:js}\r\nvar window = Ti.UI.createWindow(),\r\n webView = Ti.UI.createWebView({\r\n 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'\r\n }),\r\n mainActivity = Ti.Android.currentActivity;\r\n \r\nwebView.onCreateWindow = function(e) {\r\n var newWebView = Ti.UI.createWebView({\r\n blacklistedURLs: ['.pdf']\r\n }),\r\n newWin = Ti.UI.createWindow();\r\n\r\n newWebView.onCreateWindow = webView.onCreateWindow;\r\n \r\n newWebView.addEventListener('blacklisturl', function(e) {\r\n newWin.close();\r\n mainActivity.startActivity(Ti.Android.createIntent({\r\n action : Ti.Android.ACTION_VIEW,\r\n type : 'application/pdf',\r\n data : e.url\r\n }));\r\n });\r\n \r\n newWin.add(newWebView);\r\n newWin.open();\r\n \r\n return newWebView;\r\n};\r\n \r\nwindow.add(webView);\r\nwindow.open();\r\n{code}", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-10-31T16:57:53.000+0000", "updated": "2017-10-31T16:57:53.000+0000" }, { "id": "434536", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "7_1_X: https://github.com/appcelerator/titanium_mobile/pull/9828", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-02-15T20:22:35.000+0000", "updated": "2018-02-15T20:22:35.000+0000" }, { "id": "435619", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hknoechel] [~amukherjee] [~kiguchi] We need a parity ticket for iOS and Win", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-14T22:13:21.000+0000", "updated": "2018-03-14T22:13:21.000+0000" }, { "id": "435624", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~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. Maybe {{link}} ?-\r\n\r\nUpdate: Just rejogged my memory and realised we can't make this an event. This must be a callback.", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-14T23:26:30.000+0000", "updated": "2018-03-14T23:28:37.000+0000" }, { "id": "437714", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed. \r\nWaiting for CR to pass.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-16T21:49:37.000+0000", "updated": "2018-05-16T21:49:37.000+0000" }, { "id": "437888", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "Bumping to 7.4.0 to coordinate iOS and Windows implementations:\r\n- TIMOB-26063\r\n- TIMOB-25868", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2018-05-23T17:39:51.000+0000", "updated": "2018-05-23T17:39:51.000+0000" }, { "id": "442895", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR Merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-10-24T00:40:33.000+0000", "updated": "2018-10-24T00:40:33.000+0000" }, { "id": "442926", "author": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix on 7.5.0.v20181024102947.Works fine.Closing\r\n{code}\r\n Name = Mac OS X\r\n Version = 10.13.6\r\n Architecture = 64bit\r\n # CPUs = 8\r\n Memory = 17179869184\r\nNode.js\r\n Node.js Version = 8.12.0\r\n npm Version = 6.4.1\r\nTitanium CLI\r\n CLI Version = 5.1.1\r\nTitanium SDK\r\n SDK Version = 7.5.0.v20181024102947\r\nStudio Version =5.1.2.201810080801\r\nDevice =Samsung s5 android 6\r\nEMulator =pixel android 9\r\n{code}", "updateAuthor": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2018-10-24T22:03:08.000+0000", "updated": "2018-10-24T22:03:08.000+0000" } ], "maxResults": 23, "total": 23, "startAt": 0 } } }