{ "id": "126596", "key": "TIMOB-16478", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": [], "resolution": null, "resolutiondate": null, "created": "2014-02-19T18:20:46.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "webView" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:17.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [], "description": "Ability to fire event from a web view when the contents are loaded from a hosted site (e.g. non local resource)\r\n\r\nIf your web contents are stored locally in the assets folder, then the Ti.App.fireEvent works and the titanium app can respond.\r\n\r\ne.g.:\r\n\r\nTi.App.fireEvent('app:fromWebView', { message: 'event fired from WebView, handled in Titanium' });\r\n\r\nIf the web contents are stored on a web site, then the event doesn't fire.\r\n\r\nThis has come up twice today, once with Scott's and once with Louisville, Gas & Electric.\r\n\r\nBoth prospects have existing HTML5 web apps that they would want to use with an Appcelerator container. Event firing is useful for normal native/web view interaction as well as for leveraging Analytics and Breadcrumbs for the web view by firing an event to the native app and having the native app fire an analytics feature event and breadcrumb events.\r\n\r\nI have provided a sample app where you can switch between local and remote html resources (settable in index.xml). Screen shots are also attached.\r\n\r\nAfter entering a stock symbol (AAPL) in the web view and clicking submit, the web view fires an event. The container has an event listener for the even and displays an alert.\r\n\r\nIf the web resources are local this works. If the web resources are remote, it does not.\r\n\r\nWe hope to get a workaround or a solution for this.\r\n\r\nIs there some javascript library that can be added to the remote web app so that Ti.App.fireEvent will work", "attachment": [ { "id": "46044", "filename": "app.zip", "author": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "created": "2014-02-19T18:20:47.000+0000", "size": 3325942, "mimeType": "application/zip" }, { "id": "46045", "filename": "notWorking_remote.png", "author": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "created": "2014-02-19T18:20:47.000+0000", "size": 139494, "mimeType": "image/png" }, { "id": "46076", "filename": "remoteWebFireEvent_Example.zip", "author": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "created": "2014-02-20T21:46:04.000+0000", "size": 3371827, "mimeType": "application/zip" }, { "id": "46046", "filename": "working_local.png", "author": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "created": "2014-02-19T18:20:47.000+0000", "size": 120135, "mimeType": "image/png" } ], "flagged": false, "summary": "Ability to fire event from a web view when the contents are loaded from a hosted site (e.g. non local resource)", "creator": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "subtasks": [], "reporter": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "environment": "Production", "comment": { "comments": [ { "id": "293790", "author": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "body": "Someone from the community did find dome hack/workaround:\n\nhttp://developer.appcelerator.com/question/115911/titanium-javascript-in-webviews-for-remote-urls", "updateAuthor": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "created": "2014-02-19T18:46:33.000+0000", "updated": "2014-02-19T18:46:33.000+0000" }, { "id": "294010", "author": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "body": "Bert created a workaround that resolves the issue for now (sample attached) but it is a little cumbersome so it would be nice to have this be part of the platform.", "updateAuthor": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "created": "2014-02-20T21:45:26.000+0000", "updated": "2014-02-20T21:45:26.000+0000" }, { "id": "294011", "author": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "body": "Workaround sample", "updateAuthor": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "created": "2014-02-20T21:46:04.000+0000", "updated": "2014-02-20T21:46:04.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }