# Configuration

After adding the SDK, you must configure your project to ensure it is properly set up before you begin using the SDK. This configuration process includes setting up necessary permissions, modifying project settings, and making any additional changes required by the SDK to work correctly on both iOS and Android platforms.

## iOS Configuration

### Project Settings

Follow the instructions below to complete the necessary configuration steps.

#### Configuring Capabilities

1. Go to the Capabilities tab in your target settings.
2. Under Background Modes, enable the following:

* Location updates
* Background fetch
* Background processing&#x20;

Once configured the settings page should resemble the image below:

<figure><img src="/files/5fXf9nnuDK8Dte4oM9uP" alt=""><figcaption></figcaption></figure>

#### Setting Up Background Tasks

The GIZO SDK requires the specification of a background task identifier to handle background work. Follow these steps:

1. Go to Project settings and select your target.
2. Navigate to the Info tab.
3. Add Permitted background task scheduler identifiers if required.
4. Under this, add the sub-item:

```
de.artificient.backgroundtask.task_process
de.artificient.backgroundtask.task_refresh
```

### Permissions

Configure the required iOS permissions as specified in the table below:

* LocationUsageDescription
* LocationWhenInUseUsageDescription
* LocationAlwaysUsageDescription
* LocationAlwaysAndWhenInUseUsageDescription
* MotionUsageDescription

Refer to the React Native [permission acquisition guidelines](https://www.npmjs.com/package/react-native-permissions) for more information.

### SDK License

Create a directory in the root of your project and add the `license.json` file to it. The file should follow the format shown below:

```json
{
  "license": "<license key>"
}
```

## Android Configuration

### Permissions

Set up the required Android permissions as illustrated below:

* ACCESS\_FINE\_LOCATION
* ACCESS\_COARSE\_LOCATION
* ACCESS\_BACKGROUND\_LOCATION
* ACTIVITY\_RECOGNITION
* HIGH\_SAMPLING\_RATE\_SENSORS
* WRITE\_EXTERNAL\_STORAGE
* READ\_EXTERNAL\_STORAGE
* POST\_NOTIFICATIONS
* READ\_PHONE\_STATE
* RECORD\_AUDIO

The following items must also be configured:

* AlarmScheduler
* IgnoringBatteryOptimizations
* UsageStats

The code snippet below must be added to **Android Manifest** file to specify the configurations, permissions, and metadata for an Android application.

```xml
?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
    <uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />

    <uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" tools:ignore="ProtectedPermissions"/>
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />

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

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

    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
    <uses-permission android:name="android.permission.HIGH_SAMPLING_RATE_SENSORS" />

    <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

    <application
        android:allowBackup="true"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:fullBackupContent="@xml/backup_rules"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:name=".Application"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme"
        tools:targetApi="34" >

    </application>

</manifest>
```

### SDK License

Navigate to the `MainApplication.kt` file in your Android project, locate the `onCreate` method, and add the GIZO SDK license as shown below:

```kotlin
override fun onCreate() {
    super.onCreate()
    SoLoader.init(this, false)
    if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
      // If you opted-in for the New Architecture, we load the native entry point for this app.
      load()
    }
    ApplicationLifecycleDispatcher.onApplicationCreate(this)
    GizoSdkModule.initialize(context = this, license = "<license>")
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.artificient.de/usage/react-native/configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
