# Accessia SDK

Accessia’s SDK provides services for:

* Authentication with Accessia’s cloud backend
* Communication with nearby Accessia doors for access
* Monitoring user location while on site

## Requirements

The SDK will add some required permissions to your third party app:

* **`INTERNET`** Required to talk to Accessia Cloud
* **`POST_NOTIFICATIONS`** Required for location services & mobile access. The foreground service must surface a notification when it is started. This can be muted by the user
* **`BLUETOOTH`** Required for location services & mobile access
* **`BLUETOOTH_ADMIN`** Used by the PermissionRequester utility to turn Bluetooth on for location services, if required and allowed by the user
* **`BLUETOOTH_SCAN`** Required for location services & mobile access
* **`BLUETOOTH_CONNECT`** Required for mobile access
* **`ACCESS_COARSE_LOCATION`** Required for location services & mobile access
* **`ACCESS_FINE_LOCATION`** Required for location services & mobile access
* **`ACCESS_BACKGROUND_LOCATION`** Required for location services & mobile access. This is needed for geofencing and starting foreground services in the background
* **`FOREGROUND_SERVICE`** Required for location services & mobile access
* **`FOREGROUND_SERVICE_LOCATION`** Required for location services & mobile access
* **`RECEIVE_BOOT_COMPLETED`** Required for location services & mobile access. On boot completed, we reset the geofences and check if we need to restart the services, based on geofence location
* **`NFC`** Required for mobile access
* **`VIBRATE`** Required for mobile access

It will also declare usage of the following features:

* **`android.hardware.bluetooth_le`:** Required for location services & mobile access
* **`android.hardware.nfc.hce`:** Required for mobile access

You may need to update your Google Play store listing for some of these, such as foreground service location and background location

## Configuration

1. At the entry point of your application call `AccessiaSDK.configure(config: AccessiaConfig, callbacks: AccessiaCallbacks, logger: Timber.Tree? = null)`
2. To authenticate you must provide a pair of bearer tokens, namely authentication and refresh, to `AccessiaSDK.signIn(context: Context, customerHost: String, accessToken: String, refreshToken: String, expiresIn: Int)`
3. Call `AccessiaSDK.startServices(context: Context)` to start the location service and door service

## Get started

Speak with your Accessia account manager or partner for access to the full SDK
