CoreLocation.requestWhenInUseAuthorization
------------------------------------------

Requests permission to use location services while the app is in the foreground.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CoreLocation](component_CoreLocation.md) | [9.1](newinversion91.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "CoreLocation.requestWhenInUseAuthorization" ) ### Parameters

none

### Result

Returns OK or error.

### Description

Requests permission to use location services while the app is in the foreground.  
When the current authorization status is notDetermined, this method runs asynchronously and prompts the user to grant permission to the app to use location services. The user prompt contains the text from the NSLocationWhenInUseUsageDescription key in your app’s Info.plist file, and the presence of that key is required when calling this method.   
  
Added macOS support with MBS Plugin 11.1 for macOS 10.15 and newer.  
### See also

- [CoreLocation.requestAlwaysAuthorization](CoreLocationrequestAlwaysAuthorization.md)

### Release notes

- **Version 11.1**
    - Added [CoreLocation.requestWhenInUseAuthorization](https://www.mbsplugins.eu/CoreLocationrequestWhenInUseAuthorization.shtml), [CoreLocation.startUpdatingHeading](https://www.mbsplugins.eu/CoreLocationstartUpdatingHeading.shtml) and [CoreLocation.dismissHeadingCalibrationDisplay](https://www.mbsplugins.eu/CoreLocationdismissHeadingCalibrationDisplay.shtml) for macOS 10.15 or newer.

### Blog Entries

- [MBS FileMaker Plugin, version 11.1pr5](https://www.mbsplugins.de/archive/2021-02-20/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 17th February 2019 , last changed 16th February 2021

  
[CoreLocation.requestTemporaryFullAccuracyAuthorization](CoreLocationrequestTemporaryFullAccuracyAuthorization.md) - [CoreLocation.setDesiredAccuracy](CoreLocationsetDesiredAccuracy.md)

[HTML Version](CoreLocationrequestWhenInUseAuthorization.shtml)