Логотип Pbl V7 To V8 Migration

Pbl V7 To V8 Migration

Організація
RevenueCat
pbl-v7-to-v8-migration

Використовуйте цю навичку під час переходу застосунку Android із Play Billing Library 7.x на 8.x (остання версія — 8.3.0). Вона охоплює повний перелік несумісних змін, оновлення залежності, необхідні заміни API, мінімальне значення minSdk 23, запроваджене у версії 8.1, і покроковий процес перевірки.

Add to TypingMind

Огляд

ВидавецьRevenueCat
Репозиторійplay-billing-skills
Назва навичкиpbl-v7-to-v8-migration
Зірки
58
Форки
0
Файли в пакеті
Лише інструкції
ЛіцензіяApache-2.0
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Усе необхідне — в інструкціях

    Усе потрібне моделі міститься в інструкціях — жодних додаткових файлів для синхронізації.

  • Відкритий вихідний код

    Видавець на GitHub: RevenueCat. Перед установленням перегляньте вихідні файли навички.

Встановлення

Установіть навичку ШІ Pbl V7 To V8 Migration у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки на GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до розділу «Плагіни» → «Навички».
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/RevenueCat/play-billing-skills/tree/main/google-play/pbl-v7-to-v8-migration
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Додати навичку → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/RevenueCat/play-billing-skills.git /tmp/play-billing-skills
mkdir -p .claude/skills
cp -r /tmp/play-billing-skills/google-play/pbl-v7-to-v8-migration .claude/skills/pbl-v7-to-v8-migration
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Pbl V7 To V8 Migration в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Pbl V7 To V8 Migration, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для певного постачальника, тому навичка Pbl V7 To V8 Migration не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож поки навичка не потрібна, токени на її інструкції не витрачаються.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

Phase 0: Intent

Announce to the user: "I will migrate this project from PBL 7 to PBL 8."

State that the migration is mechanical rather than architectural. The billing flow, backend integration, and product catalog stay the same. You are replacing the methods PBL 8 deleted, updating one listener signature, and adopting a few new builder options.

If the goal is to land on the current major (PBL 9), use pbl-v7-to-v9-migration instead. It runs this same v7 to v8 work first, then applies the v8 to v9 delta. The PBL 7 deadline for new apps and updates (August 31, 2026) has already passed, and PBL 8 itself stops accepting new app and update submissions on August 31, 2027, so prefer going straight to v9 unless you have a reason to stop at 8.

Phase 1: Discovery

Gather the facts before changing anything.

  1. Locate the dependency. Open build.gradle, build.gradle.kts, or libs.versions.toml and find com.android.billingclient:billing. Record the current version string.
  2. Confirm the effective version. If the version string reads 7.x.x, treat the baseline as PBL 7. Google documents upgrading from 6 or 7 straight to 8. For a 5.x or 6.x baseline, also apply the rows marked "removed in 7.0.0" in Phase 2. A 5.x baseline also needs the removals Google lists for 6.0.0: replace queryPurchases() with queryPurchasesAsync(QueryPurchasesParams, ...) and remove the price change confirmation flow (see price-changes).
  3. Scan for removed APIs. Run a repository wide search for every identifier in the tables in Phase 2. Record every hit. Each hit is a site you must update.
  4. Check SDK levels and Kotlin. PBL 8.1 and later require minSdk 23 (the manifest merger fails below it). If the project uses billing-ktx, 8.1 and later also need the Kotlin Gradle plugin at 2.1 or newer. Note the current values; you will bump them in Phase 3 if needed.
  5. Note alternative billing usage. Grep for enableAlternativeBilling, AlternativeBillingListener, and AlternativeChoiceDetails. These were removed in PBL 7.0.0, so they only appear in a 5.x or 6.x baseline; if any hit, the rename in Step 6 applies.

Report back: "You are on PBL [current]. I found [N] call sites to migrate across [M] files. Planning a direct migration to PBL 8.3.0."

Phase 2: Plan

Build the checklist. Every item maps to a breaking change from appendix D.

Removed and changed APIs

AreaPBL 7 (removed or changed in 8.0.0)PBL 8 replacement
Purchase historyqueryPurchaseHistoryAsync()queryPurchasesAsync() (no history replacement on client)
Product queriesquerySkuDetailsAsync()queryProductDetailsAsync()
Purchases queryqueryPurchasesAsync(String, listener)queryPurchasesAsync(QueryPurchasesParams, listener)
Pending purchasesenablePendingPurchases() (no args)enablePendingPurchases(PendingPurchasesParams)
Product details callbackonProductDetailsResponse(BillingResult, List<ProductDetails>)onProductDetailsResponse(BillingResult, QueryProductDetailsResult)
Account ID extraBillingFlowParams.EXTRA_PARAM_KEY_ACCOUNT_IDnone; pass the account with BillingFlowParams.Builder.setObfuscatedAccountId()

Recommended in the same pass, not forced by the compiler:

AreaBeforePBL 8 replacement
Service reconnectionManual retry loopenableAutoServiceReconnection()
Replacement mode (8.1+)SubscriptionUpdateParams.Builder.setSubscriptionReplacementMode() (deprecated in 8.1, still compiles)ProductDetailsParams.Builder.setSubscriptionProductReplacementParams(); keep SubscriptionUpdateParams.setOldPurchaseToken()

Only for a 5.x or 6.x baseline (removed in 7.0.0, so a 7.x codebase has none of them):

AreaPBL 6 (removed in 7.0.0)Replacement
Alternative billing toggleenableAlternativeBilling()enableUserChoiceBilling()
Alternative billing listenerAlternativeBillingListenerUserChoiceBillingListener
Alternative choice detailsAlternativeChoiceDetailsUserChoiceDetails
Alternative choice productAlternativeChoiceDetails.ProductUserChoiceDetails.Product
Proration enumProrationModeSubscriptionUpdateParams.ReplacementMode
Proration settersetReplaceProrationMode(), setReplaceSkusProrationMode()setSubscriptionReplacementMode()
Old token settersetOldSkuPurchaseToken()setOldPurchaseToken()

ProrationMode to ReplacementMode constant map (5.x or 6.x baseline)

ProrationMode (PBL 6 and lower)SubscriptionUpdateParams.ReplacementMode
IMMEDIATE_WITH_TIME_PRORATIONWITH_TIME_PRORATION
IMMEDIATE_AND_CHARGE_PRORATED_PRICECHARGE_PRORATED_PRICE
IMMEDIATE_AND_CHARGE_FULL_PRICECHARGE_FULL_PRICE
IMMEDIATE_WITHOUT_PRORATIONWITHOUT_PRORATION
DEFERREDDEFERRED

KEEP_EXISTING (PBL 8.1+) exists only in the product level SubscriptionProductReplacementParams.ReplacementMode, whose integer values differ from SubscriptionUpdateParams.ReplacementMode for the same names (see Step 8).

Present the plan to the user as a checklist and confirm before editing files.

Phase 3: Execute

Work through the steps in order. Each step lifts a block from appendix D.

Step 1: Bump the dependency

Update the version string to the latest stable PBL 8 release, 8.3.0. It includes 8.1 (SubscriptionProductReplacementParams, includeSuspendedSubscriptions, pre orders), 8.2.1 (the billing program APIs), and 8.3 (external payments).

gradle
implementation("com.android.billingclient:billing-ktx:8.3.0")

From 8.1, set minSdk to 23, and with billing-ktx use the Kotlin Gradle plugin 2.1 or newer (billing-ktx 8.1+ is compiled with Kotlin 2.2 metadata, which Kotlin 2.0 cannot read).

Sync Gradle. Expect compile errors. They guide the rest of this phase.

Step 2: Fix the BillingClient builder

Replace the parameterless enablePendingPurchases() with the params object. Add enableAutoServiceReconnection() in the same builder chain.

kotlin
val billingClient = BillingClient.newBuilder(context)
    .setListener(purchasesUpdatedListener)
    .enablePendingPurchases(
        PendingPurchasesParams.newBuilder()
            .enableOneTimeProducts()
            // .enablePrepaidPlans() // optional, see below
            .build()
    )
    .enableAutoServiceReconnection()
    .build()

enableOneTimeProducts() is mandatory: build() throws "Pending purchases for one-time products must be supported." without it, and it is exactly what the old parameterless call did. enablePrepaidPlans() is optional and changes behavior: add it only if the app sells prepaid plans and handles pending prepaid purchases (no entitlement until the purchase is PURCHASED).

Step 3: Replace queryPurchaseHistoryAsync

PBL 8 removed this method. The replacement is queryPurchasesAsync, which returns active purchases only.

kotlin
val result = billingClient.queryPurchasesAsync(
    QueryPurchasesParams.newBuilder()
        .setProductType(ProductType.SUBS)
        .build()
)
result.purchasesList.forEach { purchase -> handle(purchase) }

If the app needs historical purchase data, move that lookup to the backend: record consumed purchases as you verify them, and use the Voided Purchases API (purchases.voidedpurchases.list) for refunds and revocations. If history was used to decide free trial eligibility, rely on the offers queryProductDetailsAsync() returns: Play only returns offers the user is eligible for.

Step 4: Replace querySkuDetailsAsync

Switch to queryProductDetailsAsync with the product based params builder.

kotlin
val params = QueryProductDetailsParams.newBuilder()
    .setProductList(listOf(
        QueryProductDetailsParams.Product.newBuilder()
            .setProductId("premium_monthly")
            .setProductType(ProductType.SUBS)
            .build()
    )).build()

Update downstream display code. SkuDetails.price is gone. ProductDetails exposes subscriptionOfferDetails, base plans, and pricing phases.

Step 5: Switch to the QueryProductDetailsResult callback

PBL 8 still delivers product details through a listener, but its second parameter changed from a List<ProductDetails> to a QueryProductDetailsResult, which also lists the products Play could not return.

kotlin
billingClient.queryProductDetailsAsync(params) { billingResult, queryProductDetailsResult ->
    if (billingResult.responseCode == BillingResponseCode.OK) {
        queryProductDetailsResult.productDetailsList.forEach { displayProduct(it) }
        queryProductDetailsResult.unfetchedProductList.forEach { logUnfetchedProduct(it) }
    }
}

Read unfetchedProductList during the same pass. Each UnfetchedProduct carries a productId, a productType, and a statusCode (UnfetchedProduct.StatusCode: PRODUCT_NOT_FOUND, NO_ELIGIBLE_OFFER, INVALID_PRODUCT_ID_FORMAT, UNKNOWN), which you should log for diagnostics. The billing-ktx queryProductDetails() suspend function returns only billingResult and productDetailsList; use the listener form when you need the unfetched products.

Step 6: Rename alternative billing to user choice billing (5.x or 6.x baseline only)

A 7.x codebase cannot contain the old names, because PBL 7.0.0 removed them. If Phase 1 found hits, the baseline is older; apply the rename everywhere the grep found a hit.

kotlin
.enableUserChoiceBilling(
    UserChoiceBillingListener { details ->
        val products = details.products
        val token = details.externalTransactionToken
        handleUserChoiceBilling(products, token)
    }
)

The callback payload shape is unchanged. Only the names move.

Step 7: Replace ProrationMode with ReplacementMode (5.x or 6.x baseline only)

Use the constant map in Phase 2. Update the setter name from setReplaceProrationMode to setSubscriptionReplacementMode.

kotlin
val updateParams = BillingFlowParams.SubscriptionUpdateParams.newBuilder()
    .setOldPurchaseToken(oldToken)
    .setSubscriptionReplacementMode(
        BillingFlowParams.SubscriptionUpdateParams.ReplacementMode.CHARGE_PRORATED_PRICE
    )
    .build()

On 8.1+ this setter is deprecated; Step 8 shows the replacement.

Step 8: Move the replacement mode to SubscriptionProductReplacementParams (PBL 8.1)

When targeting 8.1 or later, set the replacement mode per product on ProductDetailsParams. The old purchase token still goes on SubscriptionUpdateParams.

kotlin
val productDetailsParams = BillingFlowParams.ProductDetailsParams.newBuilder()
    .setProductDetails(newProductDetails)
    .setOfferToken(offerToken)
    .setSubscriptionProductReplacementParams(
        BillingFlowParams.ProductDetailsParams.SubscriptionProductReplacementParams.newBuilder()
            .setOldProductId(oldProductId)
            .setReplacementMode(
                BillingFlowParams.ProductDetailsParams.SubscriptionProductReplacementParams
                    .ReplacementMode.CHARGE_PRORATED_PRICE
            )
            .build()
    )
    .build()

val billingFlowParams = BillingFlowParams.newBuilder()
    .setProductDetailsParamsList(listOf(productDetailsParams))
    .setSubscriptionUpdateParams(
        BillingFlowParams.SubscriptionUpdateParams.newBuilder()
            .setOldPurchaseToken(oldToken) // still required
            .build()
    )
    .build()

Delete any setSubscriptionReplacementMode() call when you add product level params: if both are set, launchBillingFlow() returns DEVELOPER_ERROR (debug message "...cannot be called at the same time."). Use the product level ReplacementMode constants only: its integer values differ from SubscriptionUpdateParams.ReplacementMode (CHARGE_FULL_PRICE is 4 instead of 5, DEFERRED is 5 instead of 6, and 6 means KEEP_EXISTING), so a constant taken from the old interface silently selects the wrong mode. See plan-changes.

Step 9: Simplify reconnection logic

With enableAutoServiceReconnection() set in Step 2, remove manual startConnection() retries from onBillingServiceDisconnected(). Keep the callback for logging or a reconnecting UI hint if you want one.

Step 10: Adopt sub response codes (optional)

Inside PurchasesUpdatedListener, read billingResult.getOnPurchasesUpdatedSubResponseCode() for a finer grained failure reason (for example insufficient funds).

Step 11: Opt in to includeSuspendedSubscriptions (PBL 8.1, optional)

kotlin
val params = QueryPurchasesParams.newBuilder()
    .setProductType(ProductType.SUBS)
    .includeSuspendedSubscriptions(true)
    .build()

This also returns suspended subscriptions: ones the user paused, or whose renewal payment was declined and that are now on account hold. Grace period subscriptions are still active and are returned without this flag. For any purchase with isSuspended() true, do not grant access; send the user to the Play subscriptions center to fix the payment method or resume.

Step 12: Review ProGuard / R8 rules

Update any custom keep rules that name classes or methods PBL 8 removed.

Phase 4: Verify

Prove the migration works before handing back.

  1. Clean compile. Run ./gradlew clean assembleDebug. Resolve any remaining references to removed APIs. A manifest merger error about minSdkVersion means minSdk is still below 23.
  2. Unit tests. Run ./gradlew test. Fix any tests that stub the old listener shapes or replacement mode constants.
  3. Lifecycle tests on a real device with the latest Play Store. Exercise these flows:
    • New subscription purchase
    • Subscription renewal
    • Upgrade and downgrade plan changes using the product level replacement params
    • One time product purchase and consumption
    • Pending purchase completion
  4. License testing accounts. Use a license tester to repeat the flows without real charges. Pay attention to plan changes because the replacement mode constants are the riskiest site.
  5. Auto reconnection smoke test. Sever the real binding while the app holds a connected BillingClient, for example by force stopping the Play Store app (adb shell am force-stop com.android.vending). Confirm your onBillingServiceDisconnected() log fires, so you know the binding actually dropped. Then call queryPurchasesAsync() and confirm it returns OK without your code calling startConnection(). The Play Billing Lab Response Simulator cannot run this check (it never drops the binding), and airplane mode only produces NETWORK_ERROR.
  6. Unfetched product check. Temporarily add a bogus product ID to a query call. Confirm it appears in unfetchedProductList with a statusCode.
  7. Internal test track rollout. Publish to the internal track first. Monitor crash reports and billing success rates for at least one full billing cycle before promoting to production.

Report back a final summary: the old version, the new version, every change applied, new features adopted, and the verification evidence.

References

  • Full chapter

  • Upstream deadlines: PBL 7 last accepted new apps and updates on August 31, 2026 (extension window through November 1, 2026). PBL 8 is accepted until August 31, 2027.

Поширені запитання

Що робить навичка ШІ Pbl V7 To V8 Migration?

Використовуйте цю навичку під час переходу застосунку Android із Play Billing Library 7.x на 8.x (остання версія — 8.3.0). Вона охоплює повний перелік несумісних змін, оновлення залежності, необхідні заміни API, мінімальне значення minSdk 23, запроваджене у версії 8.1, і покроковий процес перевірки.

Навіщо використовувати Pbl V7 To V8 Migration у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Pbl V7 To V8 Migration — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Pbl V7 To V8 Migration у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/RevenueCat/play-billing-skills/tree/main/google-play/pbl-v7-to-v8-migration. TypingMind прочитає файл SKILL.md і встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Pbl V7 To V8 Migration?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Pbl V7 To V8 Migration?

Зі скількома забажаєте. У TypingMind ви можете використовувати Pbl V7 To V8 Migration із будь-якою моделлю, яка підтримує навички, зокрема з GPT, Claude, Gemini, Grok, DeepSeek, Mistral чи Llama. Для цього ви використовуєте власні ключі API.

Чи безкоштовна навичка ШІ Pbl V7 To V8 Migration?

Так. На GitHub цю навичку публікує RevenueCat за ліцензією Apache-2.0. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це набір інструкцій для повторного використання, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти, які вона може викликати, — код, який десь виконується й повертає результат. Натомість навичка ШІ дає моделі знання й пояснює порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі
Логотип openclaw

Solid

openclaw
ОрганізаціяПопулярне

Створюйте, переносіть, перевіряйте або тестуйте UI на Solid 2 в OpenClaw (Control UI, подання плагінів, хости Canvas), зокрема керування станом, взаємодію з Lit під час міграції, нативні оверлеї, тестування, продуктивність і…

82.4K
391.7K
Файлів: 9
Відкрити
Логотип openclaw

Auto Qa

openclaw
ОрганізаціяПопулярне

Запускайте автономні кампанії QA, живого тестування та стрес-тестування для всього OpenClaw у незалежних потоках підсистем, із перевіреними виправленнями та звітом із доказами, який можна доповнювати після перерви.

82.2K
391K
Файлів: 5
Відкрити
Логотип openclaw

Autoreview

openclaw
ОрганізаціяПопулярне

Структурований перегляд коду на прямий запит; перевага надається OpenAI/Codex перед Claude.

82.2K
391K
Файлів: 12
Відкрити
Логотип openclaw

Claw Score

openclaw
ОрганізаціяПопулярне

Перевіряйте або оновлюйте документи зі зведеною оцінкою зрілості OpenClaw на основі кореневої таксономії, оцінок зрілості та артефактів із доказами QA, не використовуючи дані maintainer discrawl або звіти про інвентаризацію в репозиторії.

82.2K
391K
Файлів: 51
Відкрити

Створіть власний робочий простір зі ШІ вже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇