CoreLocation.setPurpose
-----------------------

Sets the application-provided string that describes the reason for using location services.

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

MBS( "CoreLocation.setPurpose"; Text ) 

**MBS**( **"CoreLocation.setPurpose";** /\* Sets the application-provided string that describes the reason for using location services. \*/  
**$Text**) /\* Your purpose message.e.g. "For tracking your location." \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Text | Your purpose message. | "For tracking your location." |

### Result

Returns "OK" or error.

### Description

Sets the application-provided string that describes the reason for using location services.  
If the value of this property is non-nil, the system includes the string in the dialog that asks the user whether it is all right for your application to use location services. The string gives you a chance to explain the reason for why your application is using location services.  
You must set the value of this property prior to calling the [CoreLocation.startUpdatingLocation](CoreLocationstartUpdatingLocation.md) method. Because the string is ultimately displayed to the user, you should always load it from a localized strings file.  
Available in macOS 10.7 and later.  
### See also

- [CoreLocation.purpose](CoreLocationpurpose.md)
- [CoreLocation.startUpdatingLocation](CoreLocationstartUpdatingLocation.md)

This function checks for a license.

Created 18th August 2014 , last changed 10th August 2020

  
[CoreLocation.setDistanceFilter](CoreLocationsetDistanceFilter.md) - [CoreLocation.significantLocationChangeMonitoringAvailable](CoreLocationsignificantLocationChangeMonitoringAvailable.md)

[HTML Version](CoreLocationsetPurpose.shtml)