Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-49566

Access to GPS does not work in Android QtWebView

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.6.0
    • 5.5.1
    • WebView
    • None
    • Android 5.1.1
      Sony XPERIA C6603 (armv7)
      Androdi build SDK 22
      Android NDK r10e
      Debian 7 amd64
      Qt 5.5.1 from online installer
    • Android

    Description

      Here's minimal QML to test geolocation support by using google api example page:

      import QtQuick 2.5
      import QtQuick.Window 2.2
      import QtWebView 1.1
      
      Window {
          visible: true
      
          WebView {
              anchors.fill: parent
              url: 'https://developers.google.com/maps/documentation/javascript/examples/map-geolocation'
          }
      }
      

      AndroidManifext.xml contains:

      <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
      

      Test app settings shows that there is available permission:
      precise location (GPS and network based)

      But when Google Maps API example page loads, popup appears with text:
      Error: The Geolocation service failed.

      openstreetmaps.org also shows error:
      Geolocationerror: User denied Geolocation.

      There is no user prompt asking about permission. When openstreetmaps.org is opened in Chrome browser (not webview), it works OK after prompt.

      I cannot test with iOS though.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            talkless Vincas Dargis
            talkless Vincas Dargis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes