Check the Location Permissions
To get current location permission status, use the sdkStatus
property.
let sdkStatus = Sentiance.shared.sdkStatus
if (sdkStatus.locationPermission == .always) {
// We are good!
} else {
// Background location permission not granted.
}
if (sdkStatus.isPreciseLocationAuthorizationGranted) {
// We are good!
} else {
// Precise location permission not granted.
}
In the above example, sdkStatus
returns an SDK status object (iOS / Android) which has properties for the location permission and precision.
To be notified of location permission changes, you can set up an SDK status listener on the SDK's config object as follows:
Sentiance.shared.setDidReceiveSdkStatusUpdateHandler { status in
// Check the location permission and precision here.
}
Last updated