Skip to main content
Version: v5


Why is the location permission important?#

The location permission is required in order to allow Incognia to provide value to the user. Once allowed, Incognia SDK can start detecting location points. Users that don't accept the location permissions won't generate location data, thus, not being able to receive benefits from Incognia features.

The Incognia SDK works with the following runtime permissions: ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION and ACCESS_BACKGROUND_LOCATION.

Permission types#

The Android system has two different types of location permission: foreground and background location permissions.

Applications with foreground access will ask only for the ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION permissions. Those that need background access have to ask for ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION and ACCESS_BACKGROUND_LOCATION permissions.

Android 12 and newer devices allow the users to decide if they will grant precise (ACCESS_FINE_LOCATION) or approximate (ACCESS_COARSE_LOCATION) permission access. Not being able to acquire the ACCESS_FINE_LOCATION permission blocks the SDK from acquiring most types of location data, except for approximate GPS signals, which greatly reduces effectivity of the Incognia solution.

The absence of the ACCESS_BACKGROUND_LOCATION permission only makes it possible to collect location data when the application is in the foreground. Using background location allows Incognia to deliver better results for your application.

The Incognia SDK checks the status of these permissions and changes its behavior accordingly. The SDK will work as usual when in the foreground if only the ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permissions are granted.

If your application is targeting Android 12, you must ask for ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION as a group, always. Ask for ACCESS_BACKGROUND_LOCATION separately, as well as following the new background location access guidelines (more information can be found in the Android 12 documentation).

Asking for runtime permissions#

According to Nielsen Norman Group, world-reference in user experience research, it is easier for people to understand the context of the permission request when it is directly related to the action happening at that moment. For example, it makes more sense to ask for location permission when the person is searching for nearby stores than when they are just looking at the product catalog. The point is, always try to find out in which moment you should ask for permission and when the user will receive the benefits of that permission.

Keep in mind that, to maximize the power of Incognia's technology, as many users as possible must grant location permissions. The description of why location is used must be clear and present direct value to the user. If the permission request is hidden or linked to a feature that does not give real value, the acceptance percentage will be small and fewer users will be able to benefit from Incognia services.

Location permission disclosure#

In order to comply with the Play Store's new location policy, your app should provide a prominent in-app disclosure of your location usage. Even though this disclosure is not mandatory for apps with only the ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permissions, it is a good practice to be upfront with your users, and it can lead to a higher acceptance rate.

An example of a clear message that shows the benefits of accepting the location permissions is as follows (bracketed itens should be added if the app uses background location):

This app needs Precise [Background] Location permission

This app collects location data to enable security and fraud prevention features, such as address verification and transaction validation[, even when the app is closed or not in use]. In order to be able to do that, the app and our partner Incognia need to have access to your precise [background] location. Incognia will collect GPS, Wifi, Telephony [and Bluetooth] data and use it to provide context to your current location, protecting your transactions by preventing fraud. The data collected will not have any personal information associated. If you choose to grant approximate location permission, the protection will not be as effective.

You are free to accept or deny this usage. [If accepted, you will be taken to your phone settings in order to change the location access to "Allow all the time".]

The disclosure should have both acceptance and denial options. If accepted, only then the permissions requests should be made.

Requesting permissions#

We provide detailed code examples for location permission requests in the pages below. Choose the one that applies to your application.