Permission Handling

Required Permissions

The required permissions for the individual services vary according to the platform type. See the sections Permissions Handling for iOS and Android respectively.

Missing required and optional permissions will be reported by the SDK through the MoveServiceFailure and MoveServiceWarning listeners and listed individually so there is no need for the application to do it's own permission checks except during the onboarding process where user permission must be queried.

In best practice, this onboarding step is performed before any setup of the SDK happens, but permission changes at any later point in time is possible.

If permission checks happen at a later point make sure to call the MoveSdk.resolveError() function to ensure a timely activation of the affected services.

Due to Apple's static code analysis additional strings must be configured in the Info.plist to pass validation when uploading to the AppStoreandTestflight even when this feature is not used. See section iOS Permission Handling for details.

Special Permissions

Due to the fact that some permission requests are not available directly from react native, the SDK offers an api that can be used to request the necessary permissions and check the status of those permissions:

Android

Draw Overlays

Ask for draw over other apps permission:

MoveSdk.requestDrawOverlaysPermission(): void

Check if draw over other apps permission is granted:

MoveSdk.canDrawOverlays(): Promise<boolean>

Ignoring Battery Optimisation

Ask for ignoring battery optimisation for this app:

MoveSdk.requestAppIgnoringBatteryOptimization(): void

Check if battery optimisation is ignored for this app:

MoveSdk.isAppIgnoringBatteryOptimization(): Promise<boolean>

iOS

Motion Permission

ios.permission.MOTION is available directly from react native, but requesting this permission via react native on simulators could be problematic. This method helps to request motion permission on simulators:

MoveSdk.requestMotionPermission(): void

Last updated