Core Motion (iOS)¶
Pointr SDK and Core Motion¶
The Pointr Mobile SDK’s position engine, combined with beacon sensors, uses Core Motion sensors in order to produce an accurate blue dot position.
Core Motion and iOS 17.5¶
All iOS applications compiled with Xcode 15.4 or later (iOS SDK 17.5 or later) require the user’s authorization in order to access Core Motion data.
Like for all other types of permissions, it is required to include the Core Motion Usage Descrition key in your application’s info.plist
file. Please check our Operating System Permissions page for more information.
If your application was compiled with an older version of the iOS SDK, Core Motion will continue to work as usual and the SDK will have access to the sensors’ data without the need for user’s permission.
In summary:
Version used to compile the app | Pointr iOS SDK 8.12 or earlier | Pointr iOS SDK 8.13 or later |
---|---|---|
Xcode 15.4 or later (iOS SDK 17.5 or later) | Core Motion cannot be disabled and permission is required | Core Motion can be disabled |
Xcode 15.3 or earlier (iOS SDK 17.4.x or earlier) | Permission is not required | Permission is not required |
I don’t use Pointr’s location service. Can I disable Core Motion?¶
Starting on Pointr iOS SDK version 8.13 you can disable Core Motion. To disable it you should set the following configuration parameter on Pointr Cloud dashboard / Client configuration:
Parameter: positionManagerConfiguration_isCoreMotionEnabled
Type: Boolean
Value: false
If you disable Core Motion, it’s not required to include the Core Motion Usage Descrition key in your application’s info.plist
file.
What happens if I compile my application with Xcode 15.4 or later (iOS SDK 17.5 or later) and I use Pointr iOS SDK 8.12 or earlier?¶
If your application includes the Core Motion Usage Descrition key in the info.plist
file, the SDK will ask the user’s permission automatically the first time it runs and if granted it will work normally.
If you don’t include the key the application will crash when Pointr starts running.
I want to decide in which moment the user is asked to grant permission (Pointr SDK version 8.13 or later)¶
If you want to control when the permission is requested you can use our Permission Manager
the same way you use it for other permissions. Check Permission Manager Guide for more info.
Disable the SDK from requesting the permission automatically:¶
extension ViewController: PTRPermissionManagerDelegate {
func setPermissionManagerDelegate() {
Pointr.shared.permissionManager?.delegate = self
}
func permissionManagerShouldRequestCoreMotionAuthorizationPermission(_ permissionManager: PTRPermissionManager) -> Bool {
return false
}
}
Request the permission manually:¶
extension ViewController {
func requestPermission() {
Pointr.shared.permissionManager?.requestCoreMotionAuthorizationPermission()
}
}