Permissions
The SDK collects device data and, according to how the iOS operating system works, it requires specific permissions for each piece of data to be collected. In order to provide a customized experience for users of an application that has the SDK embedded, we implemented a mechanism that uses the parameters passed by the developer to request permissions from the user, following this flow:
-
The permissions sent as parameters to the
requestPermissionsmethod, as Strings, are requested from the user — unless they have already been requested previously. -
The user, through a dialog provided by the operating system itself, is asked about the permissions considered necessary by the framework.
-
The permissions are then granted or denied and, when the
collectDatamethod is called, it will collect only the data for which permission was granted.
If your app has already requested the required permissions, you do not need to call requestPermissions again; the SDK will inherit the permissions requested by the app.
Permissions used by the SDK
In the current SDK version, the following permissions are used if available:
- location - Captures device geolocation data
Info.plist file
The first step to enable permissions for the SDK is to configure the permission in the app’s Info.plist file, using the following line of code for each desired permission:
- location - Captures device geolocation data:
<key>NSLocationWhenInUseUsageDescription</key>
<string>Add the message you want to display to the user when iOS requests permission to access geolocation</string>
To improve the user experience when requesting permissions, you should customize the message shown in the permission request pop-up as described above.