Locations & Geofences

In this section you will find a series of more advanced functionalities that require a more complex development. We recommend that a developer be in charge of this configuration.

Activate Geolocated Notifications

The indigitall SDK can manage the user's location. This allows you to use the location filters on the send push campaign screen ( Campaigns> Push> New push campaign > Filters> Geographical Filters)

1699

Once we have enabled this functionality, the end user will have to give their consent to the location permission and enable the location services of their smartphone, so that the application can obtain the exact location of the user.

Android

Add localization permissions by including this line in the AndroidManifest.xml file:

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

<receiver android:name="com.indigitall.android.receivers.LocationReceiver"
          android:exported="false">
  <intent-filter>
    <action android:name="LocationReceiver.Action.LOCATION_UPDATE" />
  </intent-filter>
</receiver>

Include the requestLocation parameter to your initialization.

iOS

Add the following keys to the application's Info.plist file.

<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Can we always use your location?</string>

<key>NSLocationAlwaysUsageDescription</key>
<string>Can we always use your location?</string>

<key>NSLocationWhenInUseUsageDescription</key>
<string>Can we use your location when using the apps?</string>

The NSLocationAlwaysUsageDescription, NSLocationWhenInUseUsageDescription, and NSLocationAlwaysAndWhenInUseUsageDescription keys can be customized by editing the content of the tag.

Location Request

Include the requestLocation parameter to your initialization.

Indigitall.init(
  { 
    appKey: "<YOUR_APP_KEY>", 
    senderId: "<YOUR_SENDER_ID>", 
    requestLocation: true 
  });