Details
-
Type:
Improvement
-
Status: Closed
-
Priority:
Low
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: Release 9.3.0
-
Component/s: Android
-
Labels:
-
Story Points:5
-
Sprint:2020 Sprint 19
Description
Summary:
When a WebView HTML's JavaScript uses the Geolocation web API, it should automatically prompt the end-user for permission on Android 6.0 and above.
Currently, permission will always be denied unless you call the Ti.Geolocation.requestLocationPermissions() method yourself before loading the webpage.
Test Case:
- Create a Classic Titanium app project.
- Add the below Android permission to the "tiapp.xml".
- Use the below "app.js" code.
- Build and run on Android 6.0 or higher.
- Tap on the "Your Location" button in the map.
- Verify a dialog appears asking you for permission. (This is the feature we're adding.)
- Grant permission.
- Verify map shows your current location.
tiapp.xml
<ti:app> |
<android> |
<manifest> |
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> |
</manifest> |
</android> |
</ti:app> |
app.js
var window = Ti.UI.createWindow(); |
window.add(Ti.UI.createWebView({
|
url: 'https://maps.google.com', |
borderRadius: 1,
|
}));
|
window.open();
|