> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shipmobilefast.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IOS

> Setup in-app purchases for iOS

<Frame>
  <img src="https://mintcdn.com/shipmobilefast-51a499dc/rNBXOQ08cKXtmr3A/images/header/iap.png?fit=max&auto=format&n=rNBXOQ08cKXtmr3A&q=85&s=095f24dab20452f645c6dbc1f774b618" alt="In-App Purchases" className="w-full h-full rounded-xl" width="700" height="320" data-path="images/header/iap.png" />
</Frame>

We are using [RevenueCat](https://www.revenuecat.com/) to handle in-app purchases.

* Relevant Links:  [RevenueCat Docs](https://www.revenuecat.com/docs)

<Warning>
  First, you need an Apple Developer Account to setup in-app purchases.
</Warning>

## Setup

<Steps>
  <Step>
    Firstly, you need to create a new app in AppStoreConnect.

    <Frame>
      <img src="https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/ios/step1.png?fit=max&auto=format&n=eqBm0v-I9CQ3GkW-&q=85&s=0a56a9c524e196de5abb70a479fff88f" alt="Step 1" className="w-full h-full rounded-xl" width="514" height="410" data-path="images/setup/iap/ios/step1.png" />
    </Frame>
  </Step>

  <Step>
    After creating the new app button, you will see the following screen.

    <Frame>
      <img src="https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/ios/step2.png?fit=max&auto=format&n=eqBm0v-I9CQ3GkW-&q=85&s=c5e47b5003480fdcaf8333d8ae64e33d" alt="Step 2" className="w-full h-full rounded-xl" width="1198" height="1382" data-path="images/setup/iap/ios/step2.png" />
    </Frame>

    <Warning>
      Please click the `Certificate Identifiers & Profiles` link.
    </Warning>
  </Step>

  <Step>
    <Frame>
      <img src="https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/ios/step3.png?fit=max&auto=format&n=eqBm0v-I9CQ3GkW-&q=85&s=2ef0af29447f5badad3fe1316422498f" alt="Step 3" className="w-full h-full rounded-xl" width="2480" height="860" data-path="images/setup/iap/ios/step3.png" />
    </Frame>

    <Info>
      Fill the App Bundle ID with your app's bundle ID. like: `com.shipmobilefast.app` We mentioned this bundle ID in the [Quick Start section](/quickstart).

      * I mean this is your app's bundle ID.
    </Info>
  </Step>

  <Step>
    After filling the bundle ID, click the `Continue` button and turn back to New App Adding screen.

    <Frame>
      <img src="https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/ios/step4.png?fit=max&auto=format&n=eqBm0v-I9CQ3GkW-&q=85&s=3e5cc99499e0f3f097b3e3f61ab80a68" alt="Step 4" className="w-full h-full rounded-xl" width="1202" height="1386" data-path="images/setup/iap/ios/step4.png" />
    </Frame>

    <Check>
      Please click the `Create` button.
    </Check>
  </Step>

  <Step>
    After clicking the `Create` button, you will see the following screen.

    * Go to the `App Information` tab and scroll down to the `App Specific Shared Secret` section.
    * Click the `Manage` button and copy the `App Specific Shared Secret`.

    <Frame>
      <img src="https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/ios/step5.png?fit=max&auto=format&n=eqBm0v-I9CQ3GkW-&q=85&s=2a133e14c2a8c5f99011c30249127beb" alt="Step 5" className="w-full h-full rounded-xl" width="2026" height="1392" data-path="images/setup/iap/ios/step5.png" />
    </Frame>
  </Step>

  <Step>
    After clicking the `Manage` button, please click the `Generate` button.

    <Frame>
      <img src="https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/ios/step6.png?fit=max&auto=format&n=eqBm0v-I9CQ3GkW-&q=85&s=7a75799c09db2d97065f5407a379c424" alt="Step 6" className="w-full h-full rounded-xl" width="1418" height="776" data-path="images/setup/iap/ios/step6.png" />
    </Frame>
  </Step>

  <Step>
    After clicking the `Generate` button, you will see the following screen.

    <Frame>
      <img src="https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/ios/step7.png?fit=max&auto=format&n=eqBm0v-I9CQ3GkW-&q=85&s=26386c6e49aa45dfff13e5e143395852" alt="Step 7" className="w-full h-full rounded-xl" width="1920" height="976" data-path="images/setup/iap/ios/step7.png" />
    </Frame>

    <Warning>
      Please copy the `Shared Secret` value and keep it in a safe place. We will use it in the next step.
    </Warning>
  </Step>

  <Step>
    After copying the `Shared Secret` value, go back to the RevenueCat dashboard and paste it in the `App Specific Shared Secret` field.

    <Frame>
      <img src="https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/ios/step8.png?fit=max&auto=format&n=eqBm0v-I9CQ3GkW-&q=85&s=3ff65f21ae8aa320997ab05c0cef3cad" alt="Step 8" className="w-full h-full rounded-xl" width="1346" height="1088" data-path="images/setup/iap/ios/step8.png" />
    </Frame>

    <Check>
      Please click the `Set` button. But don't close this tab. If you try to `Save Changes`, you will lose the `Shared Secret` value and you will get an error.
    </Check>
  </Step>

  <Step>
    After clicking the `Set` button, you will see the following screen. Now go to the `App Store Connect` dashboard again.

    <Frame>
      <img src="https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/ios/step9.png?fit=max&auto=format&n=eqBm0v-I9CQ3GkW-&q=85&s=4a0d2b4b17b5f7cef95e423646edfc49" alt="Step 9" className="w-full h-full rounded-xl" width="2502" height="1582" data-path="images/setup/iap/ios/step9.png" />
    </Frame>
  </Step>

  <Step>
    After going to the `App Store Connect` dashboard, go to the `Users and Access` section.

    1. First copy your Issuer ID and paste it on RevenueCat `Issuer ID` field.
    2. Click the `+` button to create a new key and Download it.

    <Frame>
      <img src="https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/ios/step10.png?fit=max&auto=format&n=eqBm0v-I9CQ3GkW-&q=85&s=c509ebaf8c16aaad82102fc6dfa1b686" alt="Step 10" className="w-full h-full rounded-xl" width="2992" height="898" data-path="images/setup/iap/ios/step10.png" />
    </Frame>

    <Warning>
      Please click the `In-App Purchase` tab under the `Keys` section.
    </Warning>
  </Step>

  <Step>
    After clicking the `+` button, download the .p8 file and save it in a safe place. Then go back to the RevenueCat dashboard.

    <Check>
      Please define your app name & bundle ID.
    </Check>

    <Check>
      Please set your App-Specific Shared Secret.
    </Check>

    <Check>
      Please upload the .p8 file to the `P8 key file from App Store Connect` field.
    </Check>

    <Check>
      Please paste your `Issuer ID` to the `Issuer ID` field.
    </Check>

    <Check>
      Please click the `Save Changes` button.
    </Check>

    <Frame>
      <img src="https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/ios/step11.png?fit=max&auto=format&n=eqBm0v-I9CQ3GkW-&q=85&s=7f3950e73ed97f84249eeecfdab55e5d" alt="Step 11" className="w-full h-full rounded-xl" width="1290" height="1170" data-path="images/setup/iap/ios/step11.png" />
    </Frame>
  </Step>

  <Step>
    <Frame>
      <img src="https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/ios/step12.png?fit=max&auto=format&n=eqBm0v-I9CQ3GkW-&q=85&s=c1e93d0decc74f12b51825d0ee6dd021" alt="Step 12" className="w-full h-full rounded-xl" width="544" height="300" data-path="images/setup/iap/ios/step12.png" />
    </Frame>

    <Check>
      That's it! Now we need to implement the App Store Connect API setup.
    </Check>
  </Step>

  <Step>
    ## App Store Connect API Setup

    * Go to the `Users and Access` section.
    * Click `App Store Connect API` tab under the `Keys` section.
    * Click the `+` button to create a new key.

    <Frame>
      <img src="https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/ios/step13.png?fit=max&auto=format&n=eqBm0v-I9CQ3GkW-&q=85&s=afa25076ab52dfe78f667eba41edf5cd" alt="Step 13" className="w-full h-full rounded-xl" width="2916" height="1072" data-path="images/setup/iap/ios/step13.png" />
    </Frame>
  </Step>

  <Step>
    Generate API key for App Store Connect API.
    Name can be anything. Like name of your app. (Ship Mobile Fast API Key)

    <Frame>
      <img src="https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/ios/step14.png?fit=max&auto=format&n=eqBm0v-I9CQ3GkW-&q=85&s=92605fc01ab348f5e98863ea147d974f" alt="Step 14" className="w-full h-full rounded-xl" width="597" height="312" data-path="images/setup/iap/ios/step14.png" />
    </Frame>

    <Warning>
      Please click the `Generate` button and download the .p8 file. Please save it in a safe place.
    </Warning>
  </Step>

  <Step>
    Turn back to the RevenueCat dashboard and paste the .p8 file to the `P8 key file from App Store Connect` field.

    <Frame>
      <img src="https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/ios/step16.png?fit=max&auto=format&n=eqBm0v-I9CQ3GkW-&q=85&s=42bdb213e993b343a4a03ded79bd0faa" alt="Step 15" className="w-full h-full rounded-xl" width="2648" height="724" data-path="images/setup/iap/ios/step16.png" />
    </Frame>

    <Check>
      Please paste your `Issuer ID` to the `Issuer ID` field.
    </Check>

    <Check>
      Please click the `Save Changes` button.
    </Check>
  </Step>

  <Step>
    Then click the `Reports` link.

    <Frame>
      <img src="https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/ios/step17.png?fit=max&auto=format&n=eqBm0v-I9CQ3GkW-&q=85&s=fb1d27b1e1a5f30288d2003bc5004a23" alt="Step 17" className="w-full h-full rounded-xl" width="2242" height="344" data-path="images/setup/iap/ios/step17.png" />
    </Frame>
  </Step>

  <Step>
    Please copy the Vendor ID and paste it to the `Vendor ID` field in the RevenueCat dashboard.

    <Frame>
      <img src="https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/ios/step18.png?fit=max&auto=format&n=eqBm0v-I9CQ3GkW-&q=85&s=236ebf817604a7967354982f2b84cf5b" alt="Step 18" className="w-full h-full rounded-xl" width="2162" height="768" data-path="images/setup/iap/ios/step18.png" />
    </Frame>
  </Step>

  <Step>
    Copy your Public API Key and paste it to the `.env` file.

    <Frame>
      <img src="https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/ios/step19.png?fit=max&auto=format&n=eqBm0v-I9CQ3GkW-&q=85&s=e97554bf35db7941f9e80b9143dfe074" alt="Step 19" className="w-full h-full rounded-xl" width="1920" height="1027" data-path="images/setup/iap/ios/step19.png" />
    </Frame>

    ```
    EXPO_PUBLIC_RC_APPLE_KEY=appl_...
    EXPO_PUBLIC_RC_GOOGLE_KEY=goog_...
    ```
  </Step>

  <Step>
    <Check>
      That's it! You have successfully completed the setup for iOS.
    </Check>
  </Step>
</Steps>
