---
title: "App Store 連携を設定する"
description: "シームレスなサブスクリプション追跡のために App Store 接続を設定します。"
---

<div style={{
    maxWidth: '560px',
    margin: '0 auto 2rem',
    position: 'relative',
    aspectRatio: '16/9',
    width: '100%'
}}>
    <iframe
        style={{
            position: 'absolute',
            top: 0,
            left: 0,
            width: '100%',
            height: '100%'
        }}
        src="https://www.youtube.com/embed/VJQbzoTCkqs?si=l7BPX9mIu6GVGZ0Z"
        title="YouTube video player"
        frameBorder="0"
        allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
        referrerPolicy="strict-origin-when-cross-origin"
        allowFullScreen
    />
</div>

このセクションでは、iOS アプリの App Store と Adapty の接続を確立する方法について説明します。これは、サブスクリプション分析の表示と購入の検証を行うために必要です。インテグレーションは初回オンボーディング時、または後から Adapty ダッシュボードの **App Settings** で完了できます。

オンボーディング中にモバイルアプリと Adapty のインテグレーションを設定していた場合でも、**App settings** で後からこれらの設定を変更できます。

:::danger
設定の変更は、Adapty SDK をインストールしたモバイルアプリが公開される前のサンドボックスフェーズ中であれば安全に行えます。リリース後に変更すると、アプリの購入フローが壊れる可能性があります。
:::

## ステップ 1. Bundle ID と Apple app ID を入力する \{#step-1-provide-bundle-id-and-apple-app-id\}

**Bundle ID** と **Apple app ID** はどちらも必須です。**Bundle ID** は App Store におけるアプリの一意の識別子で、サブスクリプション処理などの Adapty のコア機能を有効にします。**Apple app ID** は、**Products** ページから[新しいプロダクトを作成してストアにプッシュする](create-product#create-product-and-push-to-store)際にも必要です。

:::note
**Apple app ID** がない場合、**Products** ページの **Create a new product and push to stores** オプションは無効になりますが、ダッシュボードにはその理由が表示されません。
:::

---
no_index: true 
---

1. [App Store Connect](https://appstoreconnect.apple.com/apps) を開きます。アプリを選択し、**General** → **App Information** セクションに進みます。

2. **General Information** サブセクションで **Bundle ID** をコピーします。

   

<Zoom>
  <img src="/docs/img/afd5012-bundle_id_apple.webp"
  style={{
    border: '1px solid #727272', /* border width and color */
    width: '700px', /* image width */
    display: 'block', /* for alignment */
    margin: '0 auto' /* center alignment */
  }}
/>
</Zoom>

3. Adapty のトップメニューから [**App settings** -> **iOS SDK** タブ](https://app.adapty.io/settings/ios-sdk) を開き、コピーした値を **Bundle ID** フィールドに貼り付けます。

   

<Zoom>
  <img src="/docs/img/2d64163-bundle_id.webp"
  style={{
    border: '1px solid #727272', /* border width and color */
    width: '700px', /* image width */
    display: 'block', /* for alignment */
    margin: '0 auto' /* center alignment */
  }}
/>
</Zoom>

4. App Store Connect の **App information** ページに戻り、**Apple ID** をコピーします。
5. Adapty ダッシュボードの [**App settings** -> **iOS SDK**](https://app.adapty.io/settings/ios-sdk) ページで、**Apple app ID** フィールドにその ID を貼り付けます。

## ステップ 2. Issuer ID と Key ID を入力する \{#step-2-provide-issuer-id-and-key-id\}

**In-app purchase Issuer ID**（App Store Connect では **Issuer ID** と表記）は、認証トークンを作成した発行者を識別する特別な ID です。**In-App Purchase Key ID**（App Store Connect では **Key ID** と表記）は、[App Store Connect でアプリ内購入キーを生成する](generate-in-app-purchase-key)セクションで生成した暗号化キーに関連付けられた一意の識別子です。

1. **App Store Connect** を開きます。[**Users and Access** → **Integrations** → **In-App Purchase**](https://appstoreconnect.apple.com/access/integrations/api/subs) セクションに進みます。
2. **Active** リストで、[App Store Connect でアプリ内購入キーを生成する](generate-in-app-purchase-key)セクションで作成したキーを見つけます。

  <img src="/assets/shared/img/19a2868-issuer_apple.webp"
  style={{
    border: '1px solid #727272', /* border width and color */
    width: '700px', /* image width */
    display: 'block', /* for alignment */
    margin: '0 auto' /* center alignment */
  }}
/>

3. **Issuer ID** をコピーして、Adapty ダッシュボードの **In-app purchase Issuer ID** フィールドに貼り付けます。

  <img src="/assets/shared/img/c2b42e7-issuer_id.webp"
  style={{
    border: '1px solid #727272', /* border width and color */
    width: '700px', /* image width */
    display: 'block', /* for alignment */
    margin: '0 auto' /* center alignment */
  }}
/>

4. **Key ID** をコピーして、Adapty ダッシュボードの **In-app purchase Key ID** フィールドに貼り付けます。

## ステップ 3. アプリ内購入キーファイルをアップロードする \{#step-3-upload-in-app-purchase-key-file\}

[App Store Connect でアプリ内購入キーを生成する](generate-in-app-purchase-key)セクションでダウンロードした **In-App Purchase Key** ファイルを

  <img src="/assets/shared/img/88cdfff-download_inapp_file.webp"
  style={{
    border: '1px solid #727272', /* border width and color */
    width: '700px', /* image width */
    display: 'block', /* for alignment */
    margin: '0 auto' /* center alignment */
  }}
/>

Adapty ダッシュボードの **Private key (.p8 file)** フィールドにアップロードします。

  <img src="/assets/shared/img/253b840-in-app_file_upload.webp"
  style={{
    border: '1px solid #727272', /* border width and color */
    width: '700px', /* image width */
    display: 'block', /* for alignment */
    margin: '0 auto' /* center alignment */
  }}
/>

## ステップ 4. トライアルと特別オファー向け – プロモーションオファーを設定する \{#step-4-for-trials-and-special-offers--set-up-promotional-offers\}

:::important
このステップは、アプリに[トライアルやその他のプロモーションオファー](offers)がある場合に必要です。
:::

1. [ステップ 2](#step-2-provide-issuer-id-and-key-id) で使用したのと同じキー ID を、**App Store promotional offers** セクションの **Subscription key ID** フィールドにコピーします。
2. [ステップ 3](#step-3-upload-in-app-purchase-key-file) で使用したのと同じ **In-App Purchase Key** ファイルを、**App Store promotional offers** セクションの **Subscription key (.p8 file)** エリアにアップロードします。

  <img src="/assets/shared/img/promo-key.webp"
  style={{
    border: '1px solid #727272', /* border width and color */
    width: '700px', /* image width */
    display: 'block', /* for alignment */
    margin: '0 auto' /* center alignment */
  }}
/>

## ステップ 5. App Store 共有シークレットを入力する \{#step-5-enter-app-store-shared-secret\}

**App Store shared secret**（App Store Connect Shared Secret とも呼ばれます）は、アプリ内購入とサブスクリプションのレシート検証に使用される 32 文字の16進数文字列です。

1. [App Store Connect](https://appstoreconnect.apple.com/apps) を開きます。アプリを選択し、**General** → **App Information** セクションに進みます。

2. **App-Specific Shared Secret** サブセクションまでスクロールします。

  <img src="/assets/shared/img/2bd112a-shared_secret_apple.webp"
  style={{
    border: '1px solid #727272', /* border width and color */
    width: '700px', /* image width */
    display: 'block', /* for alignment */
    margin: '0 auto' /* center alignment */
  }}
/>

   :::info
   **App-Specific Shared Secret** サブセクションが表示されない場合は、Account Holder または Admin ロールを持っているか確認してください。Admin ロールを持っているにもかかわらず **App-Specific Shared Secret** サブセクションが表示されない場合は、アプリの Account Holder（App Store Connect でアプリケーションを作成した人）に App Store 共有シークレットを生成するよう依頼してください。その後、Admin にもサブセクションが表示されるようになります。
   :::

3. **Manage** ボタンをクリックします。

  <img src="/assets/shared/img/2d8b4c0-shared_secret_apple_copy.webp"
  style={{
    border: '1px solid #727272', /* border width and color */
    width: '700px', /* image width */
    display: 'block', /* for alignment */
    margin: '0 auto' /* center alignment */
  }}
/>

4. 開いた **App-Specific Shared Secret** ウィンドウで、**Shared Secret** をコピーします。共有シークレットが表示されていない場合は、まず **Manage** または **Generate** のどちらか利用可能なボタンをクリックしてから、**Shared Secret** をコピーします。

5. コピーした **Shared Secret** を、Adapty ダッシュボードの **App Store shared secret** フィールドに貼り付けます。

  <img src="/assets/shared/img/4f9624d-shared_secret.webp"
  style={{
    border: '1px solid #727272', /* border width and color */
    width: '700px', /* image width */
    display: 'block', /* for alignment */
    margin: '0 auto' /* center alignment */
  }}
/>

6. Adapty ダッシュボードの **Save** ボタンをクリックして変更を確定します。

## ステップ 6. App Store Connect API キーを追加する \{#step-6-add-app-store-connect-api-key\}

App Store Connect API キーを生成して Adapty に追加すると、[Adapty ダッシュボードから App Store のプロダクトを管理](create-product#create-product-and-push-to-store)できるようになります。

1. App Store Connect で [**Users and Access > Integrations > Team keys**](https://appstoreconnect.apple.com/access/integrations/api) に移動し、**+** をクリックします。

  <img src="/assets/shared/img/app-store-connect-api.webp"
  style={{
    border: '1px solid #727272', /* border width and color */
    width: '700px', /* image width */
    display: 'block', /* for alignment */
    margin: '0 auto' /* center alignment */
  }}
/>

2. **Generate API key** ウィンドウで、キーの名前を入力し、**Admin** アクセス権を付与します。

  <img src="/assets/shared/img/generate-api-key.webp"
  style={{
    border: '1px solid #727272', /* border width and color */
    width: '700px', /* image width */
    display: 'block', /* for alignment */
    margin: '0 auto' /* center alignment */
  }}
/>

3. キーの横にある **Download** をクリックします。ダウンロードは一度しか行えません。

  <img src="/assets/shared/img/download-api-key.webp"
  style={{
    border: '1px solid #727272', /* border width and color */
    width: '700px', /* image width */
    display: 'block', /* for alignment */
    margin: '0 auto' /* center alignment */
  }}
/>

4. Adapty ダッシュボードで [**App settings > iOS SDK**](https://app.adapty.io/settings/ios-sdk) に移動し、**Connect API key** をクリックします。

  <img src="/assets/shared/img/connect-api-key.webp"
  style={{
    border: '1px solid #727272', /* border width and color */
    width: '700px', /* image width */
    display: 'block', /* for alignment */
    margin: '0 auto' /* center alignment */
  }}
/>

5. ウィンドウの各フィールドに入力します：
   - **Issuer ID**：[**Users and Access > Integrations > Team keys**](https://appstoreconnect.apple.com/access/integrations/api) からコピーします。**API keys** テーブルの上に表示されています。

  <img src="/assets/shared/img/issuer-id.webp"
  style={{
    border: '1px solid #727272', /* border width and color */
    width: '700px', /* image width */
    display: 'block', /* for alignment */
    margin: '0 auto' /* center alignment */
  }}
/>

   - **Key ID**：[**Users and Access > Integrations > Team keys**](https://appstoreconnect.apple.com/access/integrations/api) からコピーします。**API keys** テーブルのキーの横に表示されています。

  <img src="/assets/shared/img/key-id.webp"
  style={{
    border: '1px solid #727272', /* border width and color */
    width: '700px', /* image width */
    display: 'block', /* for alignment */
    margin: '0 auto' /* center alignment */
  }}
/>

   - **API key**：App Store Connect からダウンロードした API キーファイルをアップロードします。

  <img src="/assets/shared/img/app-store-connect-key.webp"
  style={{
    border: '1px solid #727272', /* border width and color */
    width: '500px', /* image width */
    display: 'block', /* for alignment */
    margin: '0 auto' /* center alignment */
  }}
/>

6. **Connect** をクリックします。

**次のステップ**

- [App Store サーバー通知を有効にする](enable-app-store-server-notifications)