# 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 (up to multiple seconds on some devices) to complete. Make sure you wait for the completion before triggering an eSIM installation.
{% endhint %}

```swift
Gigastore.isEsimCapable(completion: { (isCapable) in    
    print("\(isCapable)")}
)
```

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

* Your [device](/technical-integration/master.md#supported-devices) is eSIM capable
* You have added the [run script](/ios/installation.md#attention-1) for your [Info.plist](/ios/installation.md#info-plist-and-entitlements) and your [entitlements](/ios/installation.md#info-plist-and-entitlements) file.

Then there is likely another problem.

If this problem persists, **please 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](/api/first-package.md)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](/ios/install-profile.md).

```swift
let profileUID = "123456-abcde-abcde-789" // from API
Gigastore.getProfile(profileUID: self.profileUidValue, 
                     completion: { (profile, error) -> Void in
                         
   print("PreparedProfile: \(profile), error: \(error)")
})                  
```


---

# 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.giga.store/ios/activate-inventory-item.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.
