diff --git a/CppSamples/Maps/ShowDeviceLocationUsingIndoorPositioning/ShowDeviceLocationUsingIndoorPositioning.cpp b/CppSamples/Maps/ShowDeviceLocationUsingIndoorPositioning/ShowDeviceLocationUsingIndoorPositioning.cpp index 213b3f7702..7d49fe949e 100644 --- a/CppSamples/Maps/ShowDeviceLocationUsingIndoorPositioning/ShowDeviceLocationUsingIndoorPositioning.cpp +++ b/CppSamples/Maps/ShowDeviceLocationUsingIndoorPositioning/ShowDeviceLocationUsingIndoorPositioning.cpp @@ -96,15 +96,18 @@ void ShowDeviceLocationUsingIndoorPositioning::setMapView(MapQuickView* mapView) void ShowDeviceLocationUsingIndoorPositioning::requestBluetoothThenLocationPermissions() { + #ifdef PERMISSIONS_PLATFORM qApp->requestPermission(QBluetoothPermission{}, [this](const QPermission& permission) { Q_UNUSED(permission); requestLocationPermissionThenSetupILDS(); }); + #endif // PERMISSIONS_PLATFORM } void ShowDeviceLocationUsingIndoorPositioning::requestLocationPermissionThenSetupILDS() { + #ifdef PERMISSIONS_PLATFORM QLocationPermission locationPermission{}; locationPermission.setAccuracy(QLocationPermission::Accuracy::Precise); locationPermission.setAvailability(QLocationPermission::Availability::WhenInUse); @@ -114,10 +117,12 @@ void ShowDeviceLocationUsingIndoorPositioning::requestLocationPermissionThenSetu checkPermissions(); setupIndoorsLocationDataSource(); }); + #endif // PERMISSIONS_PLATFORM } void ShowDeviceLocationUsingIndoorPositioning::checkPermissions() { + #ifdef PERMISSIONS_PLATFORM if (qApp->checkPermission(QBluetoothPermission{}) == Qt::PermissionStatus::Denied) { emit bluetoothPermissionDenied(); @@ -130,6 +135,7 @@ void ShowDeviceLocationUsingIndoorPositioning::checkPermissions() { emit locationPermissionDenied(); } + #endif // PERMISSIONS_PLATFORM } // This function uses a helper class `IndoorsLocationDataSourceCreator` to construct the IndoorsLocationDataSource