{ "id": "78742", "key": "TIMOB-4982", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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": "14164", "description": "Release 3.0.2", "name": "Release 3.0.2", "archived": true, "released": true, "releaseDate": "2013-02-19" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "14165", "description": "2012 Sprint 21 API", "name": "2012 Sprint 21 API", "archived": true, "released": true, "releaseDate": "2012-10-22" }, { "id": "14273", "description": "2012 Sprint 21", "name": "2012 Sprint 21", "archived": true, "released": true, "releaseDate": "2012-10-22" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-10-12T22:08:20.000+0000", "created": "2011-08-03T18:33:39.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "api", "geolocation", "mobile", "qe-port", "webview" ], "versions": [ { "id": "13273", "description": "Release 2.0.2", "name": "Release 2.0.2", "archived": false, "released": true, "releaseDate": "2012-05-31" } ], "issuelinks": [ { "id": "38651", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "131744", "key": "TIMOB-17197", "fields": { "summary": "Android: Geolocation is not turning on in Webview", "status": { "description": "Submitted for code review", "name": "In Review", "id": "10003", "statusCategory": { "id": 4, "key": "indeterminate", "colorName": "yellow", "name": "In Progress" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "24564", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "107944", "key": "TIMOB-12300", "fields": { "summary": "Backport TIMOB-4982 to 3.0.1", "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": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true } } } } ], "assignee": { "name": "krowley", "key": "krowley", "displayName": "Karl Rowley", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-24T18:17:12.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": "My experience shows that geolocation doesn't work consistently in an Android WebView, even when {{android.permission.ACCESS_FINE_LOCATION}} is added to {{tiapp.xml}}. \r\n\r\nTo replicate:\r\n\r\n* Create simple app that loads a web page that uses geolocation APIs. In this case I used the KitchenSink app and changed the external URL in [web_views.js|https://github.com/appcelerator/titanium_mobile/blob/master/demos/KitchenSink/Resources/examples/web_views.js] to a test page for W3C browser geolocation, http://code.google.com/apis/maps/documentation/javascript/examples/map-geolocation.html.\r\n* Add to tiapp.xml:\r\n** {code:lang=xml}{code}\r\n* Save and build as usual. Install to Android device and to iOS device for comparison.\r\n* Verify that the permission privilege was added to {{build/android/AndroidManifest.xml}}.\r\n* Open KitchenSink on Android device and go to Base UI > Views > Web Views > External URL. Geolocation test fails.\r\n* Open KitchenSink in iOS device and repeat process. App requests location permission and test completes.\r\n\r\nHere is my suggested resolution to the problem:\r\n\r\n* Add the following to source code for {{TiWebChromeClient.java}}:\r\n** {code}\r\npublic void onGeolocationPermissionsShowPrompt(String origin, android.webkit.GeolocationPermissions.Callback callback) {\r\n callback.invoke(origin, true, false);\r\n}{code}\r\n* Build and update {{titanium-ui.jar}}.\r\n* Clean and build project and install new build to Android device. \r\n* Open KitchenSink on Android device and go to Base UI > Views > Web Views > External URL. Geolocation test succeeds!\r\n", "attachment": [], "flagged": false, "summary": "Geolocation not working consistently on Android WebView (with suggested patch)", "creator": { "name": "allankim", "key": "allankim", "displayName": "Allan Kim", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "allankim", "key": "allankim", "displayName": "Allan Kim", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK version: 1.7.1 (06/21/11 14:28 1293a6d)\r\nPlatform: Android 2.2.2\r\nDevice: Motorola Cliq 2 (MB611)\r\nHost OS: MacOS 10.6.8\r\n\r\nTitanium Studio, build: 1.0.2.201107130739\r\n(c) Copyright 2011 by Appcelerator, Inc. All rights reserved.\r\nBuild date: 13 July 2011, 07:42:08\r\n", "comment": { "comments": [ { "id": "161799", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Allan\r\n\r\nThank you for raising this ticket. In order to progress it, please add the missing information in the format and places requested in the guidelines at [Jira Ticket Checklist|http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-Summary%3AJiraTicketChecklist].\r\n\r\nMany thanks in advance", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-08-04T01:48:18.000+0000", "updated": "2011-08-04T01:48:18.000+0000" }, { "id": "161888", "author": { "name": "allankim", "key": "allankim", "displayName": "Allan Kim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I've updated the ticket and description to follow the guidelines in the checklist. I've also added more details to replicate both the problem and the fix. Thank you!", "updateAuthor": { "name": "allankim", "key": "allankim", "displayName": "Allan Kim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-04T12:40:37.000+0000", "updated": "2011-08-04T12:40:37.000+0000" }, { "id": "161987", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Allan\r\n\r\nMany thanks for your contribution so far.\r\n\r\nUnfortunately this ticket still requires a few changes to be progressed. Would you add the code that you have actually tested, so that we can with some certainty replicate the issue? The simpler the code, the better, as explained in [Creating Good Use-cases|http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-CreatingGoodUsecases].\r\n\r\nThe environment field looks good. Just bear in mind that there are bugs in the Android 2.2.X emulator relating to webviews, so it is likely that they will only work correctly on a physical device.\r\n\r\nI have edited your ticket to use jira markup. Try to use markup in your future tickets.\r\n\r\nThank you again", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-08-05T06:41:24.000+0000", "updated": "2011-08-05T06:41:24.000+0000" }, { "id": "162494", "author": { "name": "allankim", "key": "allankim", "displayName": "Allan Kim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Pull request sent: branch TC-186-geolocationWebViewAndroid", "updateAuthor": { "name": "allankim", "key": "allankim", "displayName": "Allan Kim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-10T14:51:50.000+0000", "updated": "2011-08-10T14:51:50.000+0000" }, { "id": "162536", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Allan\r\n\r\nThank you for the code. I will move this across to the correct project, but regrettably no action can be taken on your Pull Request until you have signed a CLA. Please see [Signing the Contributors License Agreement (CLA)|http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-SigningtheContributorsLicenseAgreement%28CLA%29] for details.\r\n\r\nPlease bear in mind the information I gave you in previous comments, about how to create a proper usecase.\r\n\r\nThanks", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-08-10T18:42:56.000+0000", "updated": "2011-08-10T18:42:56.000+0000" }, { "id": "162537", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "By the way, I am very sorry, but I made a mistake previously. I meant to say that the Android 2.3.X emulator has webview issues, rather than 2.2.X. See [Android SDK / Target Android Platform|http://wiki.appcelerator.org/display/guides/Titanium+Compatibility+Matrix#TitaniumCompatibilityMatrix-AndroidSDK%2FTargetAndroidPlatform], which explains this.", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-08-10T18:45:01.000+0000", "updated": "2011-08-10T18:45:01.000+0000" }, { "id": "170029", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Reassigning tickets, as per Tony Guntharp's request", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-10-21T07:32:20.000+0000", "updated": "2011-10-21T07:32:20.000+0000" }, { "id": "222960", "author": { "name": "krowley", "key": "krowley", "displayName": "Karl Rowley", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Pull request https://github.com/appcelerator/titanium_mobile/pull/3157", "updateAuthor": { "name": "krowley", "key": "krowley", "displayName": "Karl Rowley", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-10T20:25:17.000+0000", "updated": "2012-10-10T20:25:17.000+0000" }, { "id": "234610", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Backport task TIMOB-12300\nbackport PR https://github.com/appcelerator/titanium_mobile/pull/3719", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-01-16T11:13:00.000+0000", "updated": "2013-01-16T11:13:00.000+0000" }, { "id": "235704", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "GeoLocation works fine.\r\n\r\nVerified on:\r\n LG device Android 2.2.2\r\nSDK version: 3.1.0.v20130123144204,3.0.2.v20130122172624\r\nCLI version : 3.0.23\r\nOS : MAC OSX 10.7.5\r\nXCode : 4.5.1", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-01-24T11:14:00.000+0000", "updated": "2013-01-24T11:14:00.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }