RevenueCat カスタマーセンター(ユーザーが自分で購読を管理できる画面)をアプリに追加します。 次のような場合に使用: - ユーザーが購読管理画面の追加をリクエストしている - アプリ内でユーザーが自分の購読内容を管理できるようにしたい - 購読管理画面の表示や CustomerCenterView の呼び出しをしたい - iOS、Android、Kotlin Multiplatform、Flutter、React Native で「購読管理」ボタンを RevenueCat カスタマーセンターに接続したい
Add the RevenueCat Customer Center (self service subscription management UI) to an app. Use when the user asks to add a customer center, build a self service subscriptions screen, let users manage subscriptions in app, add a subscription management screen, present CustomerCenterView, call presentCustomerCenter, or wire a 'manage subscription' button to the RevenueCat customer center on iOS, Android, Kotlin Multiplatform, Flutter, or React Native.
次のような場合に使用:
ユーザーが、カスタム UI を自前で実装することなく、既存の顧客がアクティブなサブスクリプションの管理・返金申請・キャンセル・購入履歴の復元・サポートへの連絡を行えるすぐに使える UI を必要としている場合。
この UI は RevenueCat ダッシュボードで設定し、RevenueCatUI SDK によってレンダリングされます。
前提条件: integrate-revenuecat スキルが実行済みであること。
Customer Center が顧客データを読み込むには、Purchases.configure(…) が成功している必要があります。
作業ディレクトリを確認し、以下の順番で最初に一致したものを採用してください。
package.json に react-native-purchases のエントリ、または react-native が依存関係として含まれている。Customer Center は react-native-purchases-ui に含まれます。platforms/react-native.md を参照。expo も依存関係にある場合は、Expo プロジェクトとして記録してください。pubspec.yaml が存在する。Customer Center は purchases_ui_flutter に含まれます。platforms/flutter.md を参照。build.gradle.kts に kotlin { … } のマルチプラットフォームブロックがある、または com.revenuecat.purchases:purchases-kmp* に依存している。Customer Center の Composable は purchases-kmp-ui に含まれます。platforms/kmp.md を参照。build.gradle(.kts) に com.android.application が適用されている(KMP ではないもの)。Customer Center の Composable は com.revenuecat.purchases:purchases-ui に含まれます。platforms/android.md を参照。Package.swift、*.xcodeproj、*.xcworkspace、または Podfile が存在する。CustomerCenterView は RevenueCatUI に含まれます。platforms/ios.md を参照。複数が一致する場合(例: Flutter プロジェクト内に ios/ フォルダが存在する場合)は、ビルドを管理している最も外側のプロジェクトを採用してください。
それでも判断できない場合は、どのプラットフォームを設定したいかユーザーに確認してください。
Customer Center はダッシュボードで設定する UI です。 アクション、表示テキスト、プロモーションオファー、返金フロー、キャンセルアンケートの選択肢、サポートの連絡先などは、RevenueCat ダッシュボードの Customer Center セクションで定義します。 設定なしでは最小限のデフォルトレイアウトしかレンダリングされず、ユーザーにはほとんど有用な情報が表示されません。
意味のあるコンテンツを表示するには、購入履歴のある識別済みユーザーが必要です。
ユーザーが匿名で購入履歴がない場合、Customer Center は空の状態(または購入履歴の復元のみ)を表示します。
アプリがログインをサポートしている場合は、Customer Center を開く前に Purchases.logIn(userId) を呼び出してください。
Customer Center はペイウォールとは別のものです。 一般的なパターンとして、設定画面に「サブスクリプションを管理」という項目を設け、そこから Customer Center を開くようにします。 ペイウォールは新規購入のため、Customer Center は既存のサブスクライバー向けのものです。
UI がフローを管理します。
購入履歴の復元・キャンセル・返金・プロモーションオファーのフローはコンポーネント内で完結します。
フローを制御するためではなく、アプリ側で反応するために、ライフサイクルコールバック(onRestoreCompleted、onRefundRequestStarted、onManagementOptionSelected、onPromotionalOfferSucceeded など)をリッスンしてください。
プラットフォームによって対応状況が異なります。 Customer Center は iOS で最も早くサポートされ、その後 Android・KMP・Flutter・React Native が続きます。 対応していない機能はプラットフォームごとのファイルに記載されています。 返金申請は iOS 専用のアクションです(アプリ内返金申請を公開しているのは Apple のみ)。 Android では「サブスクリプションを管理」オプションが Google Play のサブスクリプション管理画面へのリンクになります。
**インストール済みの SDK バージョンが Customer Center をサポートしていない場合は、**手動のサブスクリプション管理画面で代替してください。具体的には、Purchases.customerInfo() からユーザーのアクティブなエンタイトルメントを表示し、Purchases.restorePurchases() ボタンを設け、ストアのサブスクリプション管理 URL へのリンクを提供します。
Customer Center の完全な機能を利用したい場合は、SDK のアップグレードをユーザーに案内してください。
検出結果に対応するプラットフォームファイルを参照してください。
platforms/ios.mdplatforms/android.mdplatforms/kmp.mdplatforms/flutter.mdplatforms/react-native.md各プラットフォームファイルは自己完結しており、インストールコマンド・Customer Center を表示するための具体的なコードスニペット・コールバックの形式が記載されています。
以下がすべて確認できるまで、統合完了と宣言しないでください。
customerInfo.entitlements.active に空でないマップを持って発火することを確認する。
ダッシュボードにキャンセル・返金・サポートのアクションが設定されている場合は、ユーザーがタップした際に対応するコールバック(onManagementOptionSelected、onRefundRequestStarted など)が発火することを確認する。onDismiss コールバックが発火すること。Customer Center は開くが内容が空の場合は、サインイン中のユーザーに購入履歴がないか、ダッシュボードの Customer Center セクションが設定されていません。 ダッシュボードで設定を修正し、リロードして再試行してください。
Use this skill when the user wants an out of the box UI that lets their customers manage active subscriptions, request refunds, cancel, restore, or contact support, without shipping custom UI. The UI is configured in the RevenueCat dashboard and rendered by the RevenueCatUI SDKs.
Prerequisite: integrate-revenuecat has already run. Purchases.configure(…) must succeed before the Customer Center can load customer data.
Inspect the working directory and pick the first match, from top to bottom:
package.json has a react-native-purchases entry, or react-native as a dependency. The Customer Center ships in react-native-purchases-ui. Read platforms/react-native.md. If expo is also a dependency, note it as an Expo project.pubspec.yaml exists at the project root. The Customer Center ships in purchases_ui_flutter. Read platforms/flutter.md.build.gradle.kts has a kotlin { … } multiplatform block, or depends on com.revenuecat.purchases:purchases-kmp*. The Customer Center composable is in purchases-kmp-ui. Read platforms/kmp.md.build.gradle(.kts) applies com.android.application (and is not KMP). The Customer Center composable is in com.revenuecat.purchases:purchases-ui. Read platforms/android.md.Package.swift, *.xcodeproj, *.xcworkspace, or Podfile at the project root. CustomerCenterView is in RevenueCatUI. Read platforms/ios.md.If several match (e.g. an ios/ folder inside a Flutter project), pick the outermost project, the one that owns the build. If still ambiguous, ask the user which platform they want to configure.
Purchases.logIn(userId) before opening the Customer Center.onRestoreCompleted, onRefundRequestStarted, onManagementOptionSelected, onPromotionalOfferSucceeded, etc.) to react in app code, not to drive the flow.Purchases.customerInfo(), expose a Purchases.restorePurchases() button, and link to the store's subscription management URL. Point the user to upgrade the SDK if they want the full Customer Center.Read the platform file that matches detection:
platforms/ios.mdplatforms/android.mdplatforms/kmp.mdplatforms/flutter.mdplatforms/react-native.mdEach platform file is self contained: install command, exact snippet to present the Customer Center, and the callback shape.
Do not claim the integration is complete until:
customerInfo.entitlements.active map. If the dashboard has Cancel / Refund / Support actions configured, verify the corresponding callback (onManagementOptionSelected, onRefundRequestStarted, etc.) fires when the user taps through.onDismiss callback.If the Customer Center opens but is empty, the signed in user has no purchases, or the dashboard Customer Center section is not configured. Fix in the dashboard, reload, and retry.
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。