Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qtpositioning-ios.qdoc
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5\page qtpositioning-ios.html
6\inmodule QtPositioning
7\title Qt Positioning on iOS
8\brief Notes on using Qt Positioning on iOS
9
10\section1 Using Qt Positioning Services from an iOS App
11
12To enable an app to use positioning services on an iOS device, entries must
13be added to the Info.plist file based on whether the positioning services
14are needed when the app is in use or when the app is running in the
15background.
16
17Once the permission is added, the user needs to grant the permission for the
18positioning services to be available when the app requests the positioning
19service. The user can change this by going into Settings > Privacy >
20Location Services, scrolling down to find the app, and selecting an option.
21The location services must be on for the positioning services to work.
22
23\section2 Using Foreground Location Services Permission
24
25If an app makes use of the positioning services when it is running, the
26Info.plist file needs to have an entry with the key \c
27NSLocationWhenInUseUsageDescription and a value with a text string giving the
28user the reason the app makes use of it.
29
30\badcode
31<key>NSLocationWhenInUseUsageDescription</key>
32<string>The reason why the app needs location services</string>
33\endcode
34
35\section2 Use Background Location Services Permission
36
37If the app makes use of location services even when it is running in the
38background, there needs to be an entry with the key \c
39NSLocationAlwaysAndWhenInUseUsageDescription and the reason as string value
40as well as \c NSLocationWhenInUseUsageDescription.
41
42\badcode
43<key>NSLocationWhenInUseUsageDescription</key>
44<string>The reason why the app needs location services</string>
45<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
46<string>The reason why the app needs location services</string>
47\endcode
48
49\note The Info.plist file is automatically generated, and changes made can be
50overwritten by qmake or CMake unless measures are taken. See
51\l {Platform Notes - iOS} for more information.
52
53*/