# Prepare eSIM Installation

### Check for eSIM capable device

First, you need to check if the device is eSIM capable.

{% hint style="warning" %}
This query may take some time to complete.
{% endhint %}

```kotlin
Gigastore.isEsimCapable { isCapable ->
    Log.i("GigastoreSDK", "isCapable: $isCapable") 
}
```

{% hint style="info" %}
If a "false" is returned from the query despite the following criteria being met:

* Your [device](https://docs.giga.store/technical-integration/master#supported-devices) is eSIM capable

Then there is likely another problem.

If this problem persists, **don't hesitate to contact <support@tunz.io>**
{% endhint %}

The `isEsimCapable` method can be used to check whether the user's device is eSIM capable or not.

## Activate Inventory Item using API

{% hint style="warning" %}
Implementation changed with SDK version 1.1.
{% endhint %}

To install an eSIM, an inventory item must first be activated using the Gigastore API on your server. For more information, refer to the [first-package](https://docs.giga.store/api/first-package "mention")API documentation.

Use the **esimProfile.uid** parameter of the API response and transfer it securely to your app.&#x20;

## Retrieve the profile

Use the `getProfile` method with the created profile uid to fetch all needed profile data. \
The method will return a profile you can install in the next step using [Install Profile](https://docs.giga.store/ios/install-profile).

```kotlin
val profileUID = "123456-abcde-abcde-789" // from API
Gigastore.getProfile(CONTEXT_PLACEHOLDER,
                     profileUID) { profile, error ->
    Log.i("GigastoreSDK", "PreparedProfile: $profile)
    Log.i("GigastoreSDK", "error: $error")
})
```

Make sure to replace `CONTEXT_PLACEHOLDER` with your current Activity or Application context.
