07 – Permissions

Situm SDK needs the user to grant some permissions in order to work properly. This section explains the most important, and how they will affect the positioning experience.

Android #

According to Android docs,  application permissions help support user privacy by protecting access to restricted data and restricted actions. Broadly, permissions can be categorized in “Install-time” and “Runtime”.

Install-time permissions declared by Situm SDK #

These permissions allow access to data and actions that extend beyond your app’s sandbox, but the data and actions present very little risk to the user’s privacy, and the operation of other apps. Situm SDK declares a series of these permissions in its Manifest, that will be granted by the user when he installs the app.

PermissionDescription
ACCESS_COARSE_LOCATIONRequired for positioning in Building Mode. If you are using Global mode, you will need the ACCESS_FINE_LOCATION permission explained in the next Section.
ACCESS_NETWORK_STATETo know if we have network or we don’t
ACCESS_WIFI_STATETo know if WiFi is ON/OFF
CHANGE_WIFI_STATETo turn WiFi ON/OFF
INTERNETTo have access to communications
BLUETOOTH_ADMINTo turn BLE ON/OFF
BLUETOOTHTo scan BLE
WAKE_LOCKTo keep CPU active while in Situm is running in the background as a Foreground Service.
FOREGROUND_SERVICETo be able to launch Situm SDK as a Foreground Service

Runtime permissions #

Also known as dangerous, they give the app additional access to restricted data, and/or allow the app to perform restricted actions that more substantially affect the system. Situm may require the following runtime permissions.

PermissionDescription
ACCESS_COARSE_LOCATIONRequired for positioning in Building Mode. If you want to perform positioning in Global Mode, you will need the ACCESS_FINE_LOCATION permission.
ACCESS_FINE_LOCATIONRequired for positioning in Global Mode (it also allows positioning in Building Mode).
BLUETOOTH_SCANTo scan BLE in Android 12 and above.
BLUETOOTH_CONNECTTo turn BLE ON/OFF in Android 12 and above.
POST_NOTIFICATIONSAllows an app to post notifications in Android 13 and above.

Runtime permisions need to be declared in the AndroidManifest.xml file of your app.

//AndroidManifest.xml
<manifest>
...
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
...
</manifest>

Then, at runtime, you will need to ask the user if they wish to grant your app this permissions. 

//MainActivity.java
...
// Warning! This is a naive way to ask for permissions for the example's simplicity
// Check https://developer.android.com/training/permissions/requesting to know how
// to ask for permissions
ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION},0);

You may follow this Android guide for more details on this topic.

Sensor access #

These are the most common things to take into account that Situm SDK needs to have access to sensors. We recommend the app developer to implement mechanisms to ensure that the user does not disable any option that is critical for its use case (e.g. detecting the state of each sensor and asking the user to change it if required).

SensorTake into account…
WiFiWiFI ON/OFF. In the system’s tray, users can turn ON/OFF WiFi. Situm can scan WiFi either way, provided that the WiFi scan ability (see next paragraph) was not turned OFF by the user. We actually recommend that WiFi is turned OFF and the user is disconnected to the WiFi.

WiFi Scanning ON/OFF. From Android >4, users can turn ON/OFF the capability to scan WiFi for positioning purposes. Usually, this is under Settings / Security & Location / Location / Scanning. If users turn OFF WiFi Scanning, Situm SDK will not be able to scan WiFi.

WiFi Throttling. From Android 9 onwards, Android implements a limitation called WiFi Throttling, that limits number of WiFi scans to 1 every 30 seconds. More information here.
BLEBLE ON/OFF. In the system’s tray, users can turn ON/OFF BLE. In case BLE is turned OFF, Situm Situm will not be able to scan BLE beacons. To avoid this, Situm SDK provides an option to automatically re-enable BLE.
BLE scanning ON/OFF. From Android >4, users can turn ON/OFF the capability to scan BLE for positioning purposes. Usually, this is under Settings / Security & Location / Location / Scanning. If users turn OFF WiFi Scanning, Situm SDK will not be able to scan BLE.
LocationFrom the system’s tray, user may turn ON/OFF the smartphone Location Services. Before Android 6.0, turning this OFF only restricted access to the GPS and WiFi scanning. From Android 6.0, it restricts access to any sensor that could be used to provide a Location, including GPS, WiFi, and BLE. Therefore, turning Location OFF will cause Situm SDK to not work at all.  

iOS #

As in Android, iOS apps running Situm will need certain permissions. These permissions can be configured from XCode tab “Settings/Info”, by creating the following keys:

You will also need to add a description to each key, which will be shown to the user at the time the app request each specific permission. For example, to ask for Blueetooth usage you can add the key “NSBluetoothAlwaysUsageDescription” with the description “Location and Bluetooth is required to find out where you are”.

Example on how to configure the permissions and their keys.

Lastly, you need to include the following snippet in your app’s code so the system requests location permissions to the user. If your don’t do this or the user doesn’t grant the permissions, your app won’t receive Situm location information. You will have an example on how to use this function in the Start Positioning Section of our Swift Quickstart Guide.

var coreLocationManager:CLLocationManager = CLLocationManager()
...

func requestLocationAuth(){
   if CLLocationManager.locationServicesEnabled() {
      let status: CLAuthorizationStatus = CLLocationManager.authorizationStatus()
      if status == CLAuthorizationStatus.notDetermined {
          coreLocationManager.requestAlwaysAuthorization()
          //or
          coreLocationManager.requestWhenInUseAuthorization()
      }
   }
}

Sensor access #

Contrary to Android, iOS does not allow to scan WiFi signals. However, BLE and Location are used in iOS, just like in Android. As in Android, the developer should implement the appropriate mechanisms to ensure that the user does not disable any option that is critical for its use case (e.g. detecting the state of each sensor and asking the user to change it if required).

Subscribe to our newsletter

BASIC INFORMATION ON DATA PROTECTION

Data controller: SITUM TECHNOLOGIES, S.L.
Contact: Data controller: situm@situm.es
Responsible for protection: dpo@situm.es
Purpose and legal basis: To manage the sending of SITUM newsletters only with consent.
Legitimation: Express consent of the interested party.
Recipients: The data will not be passed on to third parties with the exception of legal obligations.
Retention period: As long as the interested party remains subscribed to the newsletter (a link to unsubscribe will be available in each newsletter sent by Situm).
Rights: The interested party may at any time revoke their consent, as well as exercise their rights of opposition, access, conservation, rectification, limitation, deletion of data and not be subject to a decision based only on automated data processing, by writing to SITUM at the addresses indicated.
Additional Information: You can consult additional and detailed information on Data Protection in our privacy policy.

Please, download your copy here

Thank you for downloading our whitepaper. Please do not hesitate to contact us if you would like to know more about how our solutions can help your business. Download whitepaper


Close window