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

Qt on iOS always asks for "always" location permission.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.11, 6.4.1
    • Positioning
    • None
    • iOS/tvOS/watchOS
    • 8
    • Foundation PM Prioritized

    Description

      On iOS location permissions can be asked for "while using the app" or "always". Qt internally decides for the appropriate function to call depending on whether both texts (
      NSLocationAlwaysAndWhenInUseUsageDescription
      and NSLocationWhenInUseUsageDescription) have been set or not. See https://github.com/qt/qtpositioning/blob/fb5deb7ca0ef88865674cdbfa096d8d510ca5717/src/plugins/position/corelocation/qgeopositioninfosource_cl.mm#L157

      Unfortunately, Apple seems to have introduced the requirement to always provide both texts in December 2022 (our Uploads of end of November did not have this requirement).

      If someone is looking for a short-term workaround, you can use method swizzling and replace the implementation of requestAlwaysAuthorization with the one of requestWhenInUseAuthorization.

      Attachments

        Activity

          People

            cnn Qt Core & Network
            theoriginalgri Christoph Keller
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: