-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update samples to request permissions #1753
Changes from 12 commits
de8130c
43d2353
7f9d59c
53fe261
09c57fd
23e4a49
73f6257
156c0c6
c2cf43c
f8146b1
399978a
2f47278
3dd8474
6c97067
cace754
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
// Qt headers | ||
#include <QMap> | ||
#include <QObject> | ||
#include <QPermissions> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't need to be here anymore. Should be in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added to cpp file |
||
|
||
namespace Esri::ArcGISRuntime | ||
{ | ||
|
@@ -52,6 +53,8 @@ class ShowDeviceLocationUsingIndoorPositioning : public QObject | |
signals: | ||
void mapViewChanged(); | ||
void locationPropertiesChanged(); | ||
void locationPermissionDenied(); | ||
void bluetoothPermissionDenied(); | ||
|
||
private: | ||
Esri::ArcGISRuntime::MapQuickView* mapView() const; | ||
|
@@ -61,6 +64,9 @@ class ShowDeviceLocationUsingIndoorPositioning : public QObject | |
void setupIndoorsLocationDataSource(); | ||
void locationChangedHandler(const Esri::ArcGISRuntime::Location& loc); | ||
void changeFloorDisplay(); | ||
void requestLocationPermissionThenSetupILDS(); | ||
void requestBluetoothThenLocationPermissions(); | ||
void checkPermissions(); | ||
|
||
Esri::ArcGISRuntime::Map* m_map = nullptr; | ||
Esri::ArcGISRuntime::MapQuickView* m_mapView = nullptr; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDisplayName</key> | ||
<string>ShowDeviceLocationUsingIndoorPositioning</string> | ||
<key>CFBundleExecutable</key> | ||
<string>ShowDeviceLocationUsingIndoorPositioning</string> | ||
<key>CFBundleGetInfoString</key> | ||
<string>ArcGIS</string> | ||
<key>CFBundleIcons~ipad</key> | ||
<dict/> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.esri.${PRODUCT_NAME:rfc1034identifier}</string> | ||
<key>CFBundleName</key> | ||
<string>${PRODUCT_NAME}</string> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>CFBundleVersion</key> | ||
<string>1.0</string> | ||
<key>NOTE</key> | ||
<string>This app is cool</string> | ||
<key>UIFileSharingEnabled</key> | ||
<string>FALSE</string> | ||
<key>UIRequiresPersistentWiFi</key> | ||
<string>NO</string> | ||
<key>LSRequiresIPhoneOS</key> | ||
<true/> | ||
<key>NSLocationWhenInUseUsageDescription</key> | ||
<string>Location required for application</string> | ||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key> | ||
<string>Location required for application</string> | ||
<key>NSBluetoothAlwaysUsageDescription</key> | ||
<string>Bluetooth access is required for Indoor Positioning</string> | ||
<key>UISupportedInterfaceOrientations</key> | ||
<array> | ||
<string>UIInterfaceOrientationPortrait</string> | ||
<string>UIInterfaceOrientationPortraitUpsideDown</string> | ||
<string>UIInterfaceOrientationLandscapeLeft</string> | ||
<string>UIInterfaceOrientationLandscapeRight</string> | ||
</array> | ||
<key>UISupportedInterfaceOrientations~ipad</key> | ||
<array> | ||
<string>UIInterfaceOrientationPortrait</string> | ||
<string>UIInterfaceOrientationPortraitUpsideDown</string> | ||
<string>UIInterfaceOrientationLandscapeLeft</string> | ||
<string>UIInterfaceOrientationLandscapeRight</string> | ||
</array> | ||
<key>UILaunchStoryboardName</key> | ||
<string>LaunchScreen</string> | ||
</dict> | ||
</plist> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDisplayName</key> | ||
<string>FindPlace</string> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All these will need to be changed to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changed |
||
<key>CFBundleExecutable</key> | ||
<string>FindPlace</string> | ||
<key>CFBundleGetInfoString</key> | ||
<string>ArcGIS</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.esri.FindPlace</string> | ||
<key>CFBundleName</key> | ||
<string>FindPlace</string> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>CFBundleVersion</key> | ||
<string>1.0</string> | ||
<key>NSLocationUsageDescription</key> | ||
<string>Location required for application</string> | ||
<key>NSLocationWhenInUseUsageDescription</key> | ||
<string>Location required for application</string> | ||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key> | ||
<string>Location required for application</string> | ||
<key>NSBluetoothAlwaysUsageDescription</key> | ||
<string>Bluetooth access is required for Indoor Positioning</string> | ||
</dict> | ||
</plist> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A default instantiated
QLocationPermission
hasAccuracy::Approximate
on macOS. We requestedAccuracy::Precise
inrequestLocationPermissionThenSetupILDS
, so best to check that we got it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are the accuracy and availability parameters checked here? The
checkPermission
only checks the status right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't explicitly state which types of
Accuracy
andAvailability
you are checking on theQLocationPermission
passed intocheckPermission()
, you'll be checking the permission status ofAccuracy::Approximate
andAvailability::WhenInUse
(on macOS).But you requested
Accuracy::Precise
andAvailability::WhenInUse
, because that is what is needed by ILDS.So what could go wrong with the current code is that you request
Accuracy::Precise
, but the user only providesAccuracy::Approximate
. And because you are only checkingAccuracy::Approximate
, the permission check passes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added