Rc Setup

RevenueCat/ai-toolkit/revenuecat-play-billing/skills/rc-setup

作者 RevenueCatccfc038185ec457b2ac9077f3bbf1ba947a44dbbApache-2.0; see LICENSE收錄於 2026年10月9日更新於 2026年10月9日

Use this skill when setting up a RevenueCat project for Android: creating the app in the dashboard, uploading the Google Play service account credentials, configuring entitlements and offerings, and getting the public SDK API key for the Android app.

AI 產生的概覽

指導在控制台端完成 RevenueCat Android 專案設定,從建立應用程式到取得公開 SDK API 金鑰。

功能
逐步說明如何為 Android 設定 RevenueCat 專案:建立專案與 Android 應用程式、建立並上傳 Google Cloud 服務帳戶金鑰、連接 Google Play、定義權益、匯入產品並建立 offering。最後提供驗證檢查項目,以及公開的 Android SDK API 金鑰、offering 識別碼與權益識別碼,用來交接給 SDK 設定。僅為說明文件,不會產生檔案。
適用情境
適用於在撰寫 SDK 程式碼之前為 Android 應用程式設定 RevenueCat,或將現有 RevenueCat 專案連接到 Google Play。也適合檢查控制台與 Play Console 的設定是否完整。
執行需求
需要 RevenueCat 帳號、帶有產品或訂閱的 Google Play Console 應用程式,以及具備 Play Console 財務資料檢視權限的 Google Cloud 服務帳戶 JSON 金鑰。需要連線至 RevenueCat 與 Google Cloud 控制台的網路。不包含指令碼。

RevenueCat Android Setup

Configure a RevenueCat project so the Android SDK can fetch offerings, validate purchases, and grant entitlements. This skill covers the dashboard side of setup and the service account connection to Google Play.

The scope stops at "dashboard ready, API key in hand." SDK initialization code belongs to the rc-configuring-the-sdk skill.

Phase 1: Discovery

Confirm these items before you touch the RevenueCat dashboard. Missing any of them will block the connection step.

PrerequisiteWhere it livesWhy RevenueCat needs it
Google Play Console appPlay ConsoleDashboard connects by package name
Package namePlay Console app listingMust match your Android app exactly
In-app products or subscriptionsPlay Console monetizationRevenueCat imports the catalog
Base plans for subscriptionsPlay Console subscriptionBilling Library 6+ requires them
Google Cloud service account JSONGoogle Cloud ConsoleRevenueCat authenticates to the Play Developer API
Financial data viewer permissionPlay Console users and permissionsService account reads subscription state

Ask the user:

  • Is the app already published on Play (even as internal testing)?
  • Are products live in Play Console, or still drafts?
  • Do you have the service account JSON, or do you need the creation steps?

If products do not exist yet, pause. Product creation is a Play Console task outside this skill.

Phase 2: Plan

Pick the route that matches the user's state.

StateRoute
No RevenueCat accountStart at Step 1, create account and project
Account exists, no Android app in projectStart at Step 2, add Android app
App exists, Play not connectedJump to Step 3, upload service account
Play connected, no entitlements or offeringsJump to Step 4
Everything configured, need the API keyJump to Phase 4 verification

The default flow below runs end to end. Skip steps the user has already completed.

Phase 3: Execute

Step 1: Create the RevenueCat project and Android app

  1. Sign up or log in at app.revenuecat.com.
  2. Create a project. One project can hold Android, iOS, and web apps for the same product.
  3. Inside the project, add an Android app. Enter the Play Console package name.

RevenueCat generates a public SDK API key per platform. You will copy the Android key at the end. Do not reuse iOS or web keys in the Android app.

Step 2: Create a Google Cloud service account (if needed)

In Google Cloud Console, on the project linked to your Play Console:

  1. Enable the Google Play Android Developer API.
  2. Create a service account. Skip role grants on the Cloud side.
  3. Create a JSON key for the service account and download it.

In Play Console, under Users and permissions:

  1. Invite the service account email.
  2. Grant app-level access to the app.
  3. Grant the Financial data viewer permission. RevenueCat needs it to read subscription state.

Step 3: Connect Google Play in RevenueCat

In the RevenueCat dashboard, open the Android app settings:

  1. Confirm the package name matches Play Console.
  2. Upload the service account JSON key file.
  3. Save.

RevenueCat validates the credential by calling the Play Developer API. If validation fails, the common causes are missing API enablement, wrong project, or the service account not yet propagated in Play (allow up to 24 hours).

Step 4: Create entitlements

Entitlements are the access levels your app checks. Define them once, reference them everywhere in client code.

In the dashboard under Entitlements, create one per access tier. Most apps ship with a single entitlement.

IdentifierDescription
pro_accessUnlocks premium features
team_accessUnlocks team features (second tier, optional)

Use a stable identifier. Renaming an entitlement later means rewriting every feature gate.

Step 5: Import products and attach entitlements

Under Products, click Import. RevenueCat pulls the Play catalog through the connected service account.

  1. Select each product you want RevenueCat to manage.
  2. Attach each product to an entitlement. Purchasing the product grants that entitlement.

A single entitlement can back many products (monthly, annual, lifetime all unlock pro_access).

Step 6: Create an offering

Offerings drive what a user sees on the paywall. One offering groups multiple packages.

Under Offerings:

  1. Create an offering (for example, default).
  2. Add packages. Pick a package type (Monthly, Annual, Lifetime, or custom) and assign a product.
  3. Mark one offering as Current.

The Android SDK fetches offerings.current to show the default paywall. Swap the current offering later from the dashboard without shipping an app update.

Step 7: Copy the Android API key

In the Android app settings, copy the public SDK API key. This value is the second argument to PurchasesConfiguration.Builder. The skill configuring-the-sdk uses it.

kotlin
// Handed off to configuring-the-sdkval revenueCatApiKey = "goog_xxxxxxxxxxxxxxxxxxxxxxxx"

Phase 4: Verify

Confirm the dashboard and Play Console are wired together before moving to SDK work.

CheckHow to verifyPass signal
Service account acceptedRevenueCat app settings, Google Play sectionShows connected with a green indicator
Products importedProducts tab in dashboardPlay products appear with live prices
Entitlement attachmentsOpen each productShows the attached entitlement
Offering currentOfferings tabOne offering tagged Current
Package product linksOpen the current offeringEach package shows a product identifier
API key scopeProject settings, API keysAndroid key is distinct from iOS and web keys

Ask the user to confirm each row. If a product shows no price, the service account is connected but the product is not active in Play. Fix the Play listing, then re-import.

Hand off to rc-configuring-the-sdk with:

  • The Android API key
  • The current offering identifier
  • The entitlement identifiers the app will check

References

來源與署名

來源:RevenueCat/ai-toolkit位於revenuecat-play-billing/skills/rc-setup提交ccfc038

授權條款: Apache-2.0; see LICENSE

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架