---
title: "Google Play ConsoleでリアルタイムデベロッパーNotification（RTDN）を有効にする"
description: "Google Play ConsoleでリアルタイムデベロッパーNotification（RTDN）を有効にしてAdaptyのデータ精度を維持しましょう。払い戻しやその他の重要なイベントに関する即時更新を受け取るためのRTDNセットアップ方法を学びます"
---

リアルタイムデベロッパーNotification（RTDN）を設定することは、データ精度を確保するうえで非常に重要です。これにより、払い戻しやその他のイベントに関する情報を含む、Play Storeからの更新をリアルタイムで受け取れるようになります。

## 通知を有効にする \{#enable-notifications\}

1. **Google Cloud Pub/Sub** が有効になっていることを確認してください。[こちらのリンク](https://console.cloud.google.com/flows/enableapi?apiid=pubsub)を開き、アプリのプロジェクトを選択します。**Google Cloud Pub/Sub** をまだ有効にしていない場合は、ここで有効にする必要があります。

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

2. Adaptyのトップメニューから [**App settings > Android SDK**](https://app.adapty.io/settings/android-sdk) に移動し、**Google Play RTDN topic name** タイトルの横にある **Enable Pub/Sub API** フィールドの内容をコピーします。

   

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

<p> </p>

:::note
**Enable Pub/Sub API** フィールドの内容が正しくない形式の場合（正しい形式は `projects/...` で始まります）、[Enable Pub/Sub APIフィールドの形式を修正する](enable-real-time-developer-notifications-rtdn#fixing-incorrect-format-in-enable-pubsub-api-field) セクションを参照してください。

:::

3. [Google Play Console](https://play.google.com/console/) を開き、アプリを選択して、**Monetize with Play** -> **Monetization setup** に進みます。**Google Play Billing** セクションで、**Enable real-time notifications** チェックボックスをオンにします。

4. Adaptyの **App Settings** でコピーした **Enable Pub/Sub API** フィールドの内容を、**Topic name** フィールドに貼り付けます。
5. Google Play Consoleで **Save changes** をクリックします。

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

## 通知をテストする \{#test-notifications\}

リアルタイムデベロッパーNotificationへの登録が成功したかどうかを確認するには：

1. Google Play Consoleの設定で変更を保存します。
2. Google Play Consoleの **Topic name** の下にある **Send test notification** をクリックします。

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

3. AdaptyのメニューにあるトップメニューからAdaptyの [**App settings > Android SDK**](https://app.adapty.io/settings/android-sdk) に移動します。テスト通知が送信されると、トピック名の上にそのステータスが表示されます。

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

## Enable Pub/Sub APIフィールドの形式を修正する \{#fixing-incorrect-format-in-enable-pubsub-api-field\}

**Enable Pub/Sub API** フィールドの内容が誤った形式の場合（正しい形式は `projects/...` で始まります）、以下の手順に従って問題を解決してください。

### 1. APIの有効化と権限を確認する \{#1-verify-api-enablement-and-permissions\}

必要なAPIがすべて有効になっており、サービスアカウントに正しく権限が付与されていることを慎重に確認してください。これらの手順をすでに完了している場合でも、サブステップが抜けていないことを確かめるために再度確認することが重要です。以下のセクションの手順を繰り返してください：

1. [Google Play ConsoleでデベロッパーAPIを有効にする](enabling-of-devepoler-api)
2. [Google Cloud Consoleでサービスアカウントを作成する](create-service-account)
3. [Google Play Consoleでサービスアカウントに権限を付与する](grant-permissions-to-service-account)
4. [Google Play Consoleでサービスアカウントのキーファイルを生成する](create-service-account-key-file)
5. [Google Play Storeインテグレーションを設定する](google-play-store-connection-configuration)

### 2. ドメインポリシーを調整する \{#2-adjust-domain-policies\}

**Domain restricted contacts** および **Domain restricted sharing** ポリシーを変更します：

1. [Google Cloud Console](https://console.cloud.google.com/) を開き、アプリを管理するためのサービスアカウントを作成したプロジェクトを選択します。
2. **Quick Access** セクションで、**IAM & Admin** を選択します。

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

3. 左ペインで **Organization Policies** を選択します。
4. **Domain restricted contacts** ポリシーを見つけます。

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

5. **Actions** 列の省略記号ボタンをクリックし、**Edit policy** を選択します。
6. ポリシー編集ウィンドウで：
   1. **Policy source** の下で、**Override parent's policy** ラジオボタンを選択します。
   2. **Policy enforcement** の下で、**Replace** ラジオボタンを選択します。
   3. **Rules** の下で、**ADD A RULE** ボタンをクリックします。

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

   4. **New rule** -> **Policy values** の下で、**Allow All** を選択します。

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

   5. **SET POLICY** をクリックします。
7. **Domain restricted sharing** ポリシーについても、手順4〜6を繰り返します。

最後に、**Google Play RTDN topic name** タイトルの横にある **Enable Pub/Sub API** フィールドの内容を再作成します。フィールドは正しい形式になります。

リアルタイムデベロッパーNotification（RTDN）の有効化に成功したら、更新したポリシーの **Policy source** を **Inherit parent's policy** に戻すことを忘れずに行ってください。

## 生イベントの転送 \{#raw-events-forwarding\}

場合によっては、Googleからの生のS2Sイベントを引き続き受け取りたいこともあるでしょう。Adaptyを使用しながらそれらを受け取り続けるには、**URL for forwarding raw Google events** フィールドにエンドポイントを追加するだけで、Googleからの生イベントをそのまま送信します。

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

---
**次のステップ**

以下のプラットフォーム向けにAdapty SDKを設定します：

- [Android](sdk-installation-android)
- [React Native](sdk-installation-reactnative)
- [Flutter](sdk-installation-flutter)
- [Kotlin Multiplatform](sdk-installation-kotlin-multiplatform)
- [Unity](sdk-installation-unity)