Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [SOLVED] GPS location fix working on Android but not iOS
QtWS25 Last Chance

[SOLVED] GPS location fix working on Android but not iOS

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 3 Posters 2.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    carlinski
    wrote on last edited by
    #1

    QT 5.4 c++

    Compiled app OK and all running on iPad. What is strange is that it doesn't ask is it ok to use location information etc.

    When calling

    @QGeoPositionInfoSource* source = QGeoPositionInfoSource::createDefaultSource(this);@

    It gives a valid pointer.

    This all runs well with the same code on Android. I get regular position updates.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      carlinski
      wrote on last edited by
      #2

      Taken from the documentation for

      @QGeoPositionInfoSource::​startUpdates()@

      Adding the key in Info.plist got it all working. Hope this is of help to someone.

      On iOS, starting from version 8, Core Location framework requires additional entries in the application's Info.plist with keys NSLocationAlwaysUsageDescription or NSLocationWhenInUseUsageDescription and a string to be displayed in the authorization prompt. The key NSLocationWhenInUseUsageDescription is used when requesting permission to use location services while the app is in the foreground. The key NSLocationAlwaysUsageDescription is used when requesting permission to use location services whenever the app is running (both the foreground and the background). If both entries are defined, NSLocationWhenInUseUsageDescription has a priority in the foreground mode.

      1 Reply Last reply
      1
      • michaelLM Offline
        michaelLM Offline
        michaelL
        wrote on last edited by
        #3

        Hi,

        i am facing the same issue.
        Where do i find this key? and where do i find Info.plist?

        Thank you,

        Michael

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          You have to create your own if the default one doesn't suite your needs.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved