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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 5.15.14, 6.2.9, 6.5.2
    • 5.15.11, 6.4.1
    • Positioning
    • None
    • iOS/tvOS/watchOS
    • 8
    • 697f2dbb5 (6.5), e6426f116 (tqtc/lts-6.2), fd429f764 (tqtc/lts-5.15)
    • Foundations Sprint 80, Foundation Sprint 81

    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

        For Gerrit Dashboard: QTBUG-109359
        # Subject Branch Project Status CR V

        Activity

          People

            ivan.solovev Ivan Solovev
            theoriginalgri Christoph Keller
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes