RevenueCat カスタマーセンター(ユーザーが自分で購読内容を管理できる画面)をアプリに追加します。 次のような場合に使用: - ユーザーがカスタマーセンターの追加をリクエストしている - ユーザーが自分で管理できる購読画面を構築したい - アプリ内でユーザーが購読内容を管理できるようにしたい - 購読管理画面を追加したい - CustomerCenterView を表示したい - presentCustomerCenter を呼び出したい - 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 など)を使用してください。
プラットフォームによって利用可能な機能が異なります。 iOS が最も早く Customer Center をサポートしており、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 による自動翻訳です。