> For the complete documentation index, see [llms.txt](https://docs.quizhour.mrb-lab.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.quizhour.mrb-lab.com/iap-setup/17.-points-store-setup/17.2-ios-setup.md).

# 17.2 iOS Setup

## Sign A Paid Application Agreement

The first and foremost thing you have to do is to accept the agreement. Go to **app store connect -> Agreements, Tax, and Banking**. You will see two agreements. One for Free Apps and the second for Paid Apps.

Free apps agreement doesn’t require you to add your bank account and fill in the Tax information, but Paid Apps do require. You need to accept the Paid Apps agreement. Once you accepted the agreement and filled in the necessary information, your status of agreements will be active. Just like this 👇🏻👇🏻👇🏻

<div align="left"><figure><img src="https://3767936052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fcv8FlmekAQLXUn7f8PbK%2Fuploads%2FU3ZFOC6JQzHQ1slytjIO%2Fimage.png?alt=media&amp;token=b3ae85b4-87aa-4379-95fd-4ff69fc4c08d" alt=""><figcaption></figcaption></figure></div>

## Configure In-App Purchase in App Store Connect

From your Appstore Connect, go to Your App > **In-App Purchases**. Now, your need to create the products which you want to sell. We are selling consumable points in our app which users can purchase multiple times.

<figure><img src="https://3767936052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fcv8FlmekAQLXUn7f8PbK%2Fuploads%2FgD2Zk0mfvyqAIeMEcFpE%2FScreenshot%202023-05-16%20at%201.57.25%20PM.png?alt=media&amp;token=bdf0f740-090b-45a1-acff-43830afb0cae" alt=""><figcaption></figcaption></figure>

#### Create IAP Products

Create A IAP Product by clicking on the (+) button. Select **Consumable** as Type, Add a reference name, and add your product name.

{% hint style="info" %}
Reference names can be anything you want to use. Reference names won't be visible in the app.
{% endhint %}

{% hint style="info" %}
Product ID can be anything but unique. If you are using the IAP in **Android** also, then make sure that both product IDs are the same.
{% endhint %}

<div align="left"><figure><img src="https://3767936052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fcv8FlmekAQLXUn7f8PbK%2Fuploads%2F9oc0a54KvLJP76ml0Jno%2FScreenshot%202023-05-16%20at%202.03.23%20PM.png?alt=media&amp;token=f2468446-9d9a-4079-b75a-e1009b599bac" alt=""><figcaption></figcaption></figure></div>

#### Setup Availability

Set up the availability of your IAP Product. You can select all of the countries if you want to sell the products to all.

<div align="left"><figure><img src="https://3767936052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fcv8FlmekAQLXUn7f8PbK%2Fuploads%2FSv5w0lxs4FvkiW7izVJ5%2FScreenshot%202023-05-16%20at%202.28.22%20PM.png?alt=media&amp;token=79fa7f8b-a45a-420d-b02f-eb0ec76d74cc" alt=""><figcaption></figcaption></figure></div>

#### Pricing Setup

Select the price of the product. You should select the **United States (USD)** as the Base country. Complete the pricing setup by clicking next...Done.

<div align="left"><figure><img src="https://3767936052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fcv8FlmekAQLXUn7f8PbK%2Fuploads%2FhaPyERo0XsP0LWFc9ZDO%2FScreenshot%202023-05-16%20at%202.31.12%20PM.png?alt=media&amp;token=21308d3c-7595-4abe-8b38-facd74b01824" alt=""><figcaption></figcaption></figure></div>

#### Setup AppStore Localization

Click on the **Add Localization**. **Add Display Name** which will be shown on the app. You should write how many points you want to sell here. Like **60 Points**. Add a Description of the product. This can be anything.

{% hint style="info" %}
You should select English (US) as Localization. Don't enter anything else in the Display name. Just write how many points you want to sell (Like in the picture below)
{% endhint %}

<div align="left"><figure><img src="https://3767936052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fcv8FlmekAQLXUn7f8PbK%2Fuploads%2FvV8L9ATLMv3aKCTCpJWD%2FScreenshot%202023-05-16%20at%202.37.41%20PM.png?alt=media&amp;token=5791a3cd-418d-40c9-a869-e50de181ef1b" alt=""><figcaption></figcaption></figure></div>

Save the product. That's it.

{% hint style="info" %}
You can create as many products as you want in this way.
{% endhint %}

#### Add the In-App Purchase Feature in Xcode

From the app source code open the **quiz\_app/ios** folder in your **Xcode** App. Now go to the **Runner > Signing & Capabilities** and click on the **+ Capability** and add the **In-App Purchase** option. That's it.

<div align="left"><figure><img src="https://3767936052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fcv8FlmekAQLXUn7f8PbK%2Fuploads%2Flv8kEpXx5XBF3RWYeV3K%2FScreenshot%202023-05-20%20at%202.36.38%20PM.png?alt=media&amp;token=64675851-d39c-41d5-bb0e-c34a4a6f57be" alt=""><figcaption></figcaption></figure></div>
