Targeting

Request permissions

This step is completely optional and should only be implemented if it is convenient for the application’s purpose.

The app may request the location permissions so that our SDK can obtain the user's current location and display more relevant ads based on that information.

For this, it is necessary to add the following permissions in the AndroidManifest.xml file:

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

Following this, the app must request the permissions so that users can grant them.

Example

private static final String[] PERMISSIONS = {
    Manifest.permission.ACCESS_FINE_LOCATION,
    Manifest.permission.ACCESS_COARSE_LOCATION
};

ActivityCompat.requestPermissions(this, PERMISSIONS, 100);

Última actualización