The purchase sheet never appears, or the purchase call never returns
When tapping Buy shows no sheet, or the purchase call never returns, the store usually had nothing on screen to attach its sheet to. On iOS that means no visible window or scene. On Android it means no foreground Activity. Start purchases from a user tap on a visible screen, not from a background task or launch code. On iOS, look in the console for Could not find a UI anchor or confirmation scene. On Android, check the billing client is connected first.
Symptom
- Tapping Buy does nothing: no App Store or Google Play sheet appears.
- The purchase call never resolves, or resolves much later.
- On iOS the call may throw
StoreKitError.unknown, and the console shows one of:
Could not get confirmation scene ID for com.example.pro.monthly
Could not find a UI anchor for com.example.pro.monthly purchase.
Could not find a visible window in the scene for com.example.pro.monthly purchase.
- On Android the sheet never opens and nothing reaches your purchases listener.
Why it happens
| Cause | Platform | How to tell |
|---|---|---|
| No visible window, scene or Activity to present from | Both | The purchase starts from a background task, at launch, from an extension, or after the screen was dismissed |
| iOS 18.2 / 18.2.1 bug with full-screen modals and extra windows | iOS | Could not get confirmation scene ID on iOS 18.2.x only |
| Billing client not connected yet, or disconnected | Android | Purchase starts before onBillingSetupFinished, or after SERVICE_DISCONNECTED |
| No Play Store on the device, or an outdated one | Android | Emulator without Play, BILLING_UNAVAILABLE |
| The purchase is pending (Ask to Buy, slow payment method) | Both | The result is pending, and your code only waits for the call |
| A StoreKit configuration file is on in the Xcode scheme | iOS | The sheet works in Xcode runs only, or the reverse |
The iOS 18.2 bug: the sheet didn't appear when the key window's root view controller was out of the view hierarchy. Typical triggers were UIKit .fullScreen presentation, SwiftUI fullScreenCover, or an extra UIWindow without a root view controller. It was reported fixed in iOS 18.3.
Confirm it
- iOS: run from Xcode, tap Buy, and search the console for
UI anchor,visible windoworconfirmation scene. Any of these means StoreKit had nothing to present from. Note the device's iOS version. - iOS: log the full error, including
NSUnderlyingError. A UI message there points to this page. An HTTP 500 points to SKErrorDomain Code=0 instead. - Android: turn on Play Billing's own logging and read logcat while you tap Buy:
adb shell setprop log.tag.BillingClient VERBOSE
adb logcat | grep -i billing
The response code and debug message say whether the client wasn't ready, billing was unavailable or the request was refused.
- Both: check where the purchase call starts. If it isn't directly behind a tap on a visible screen, that's the cause.
Fix
- Start purchases from the visible screen. Trigger them from a button handler on a screen that's on screen now, never from launch code, a background task, a notification handler or an app extension.
- iOS, give StoreKit an anchor. In SwiftUI, use the
purchaseenvironment action (@Environment(\.purchase)). In UIKit on iOS 17+, callproduct.purchase(confirmIn: scene)with the window scene that's showing your paywall. - iOS 18.2.x users: present the paywall with
.overFullScreenor a sheet instead of.fullScreen/fullScreenCover, and remove extra windows that have no root view controller. - Android, pass the current Activity to
launchBillingFlow, on the main thread. In React Native and Flutter, purchase only while the app is in the foreground. - Android, wait for the connection. Call
startConnection, wait foronBillingSetupFinished, and checkisReady()before launching. On Play Billing Library 8, enable automatic reconnection withenableAutoServiceReconnection(). - Handle pending results: treat a pending purchase as "waiting for approval", tell the user, and grant access when the purchase arrives through
Transaction.updatesor your purchases listener. - Emulator: use an image with the Play Store signed in to a license tester, or a real device.
Stop it coming back
- Test the purchase from every place the paywall can open: onboarding, settings, and any full-screen modal.
- Test with Ask to Buy on, using the
simulatesAskToBuyInSandboxpurchase option, so the pending path gets exercised. - Add a timeout to your own "purchasing…" spinner, so a stuck purchase lets the user retry instead of freezing the screen.
If you use BillDog
On iOS, the SDK calls StoreKit's product.purchase(options:) without passing a scene, so the anchor rules above apply to BillDog purchases too. Concurrent purchase calls for the same product share one task. There's no timeout on the StoreKit call itself.
On Android, purchases need an Activity: call BillDog.purchase(activity, productId). Called without one, the purchase fails with BillDogError.ConfigurationError saying the BillingClient requires an Activity. If Play Billing hasn't connected within 10 seconds, the purchase fails with StoreError(0, "Billing client not ready"). Android purchases also need products that are already loaded, so call getOfferings() before showing the buy button.
React Native returns NO_ACTIVITY when there's no foreground Activity, and Flutter returns a NO_ACTIVITY error. This was checked against the source of the published SDKs, 1.1.1-beta.5. It hasn't yet been reproduced on a device for this page.
Related
Sources
- Apple: Product.purchase(confirmIn:options:)
- Apple: Testing in-app purchases with sandbox
- Apple Developer Forums: purchase sheet not shown on iOS 18.2
- RevenueCat known issue: iOS 18.2 purchase sheet may fail to appear
- Google Play Billing: integrate the library (connection, launchBillingFlow)
- Google Play Billing: handle response codes
Did this fix it?
Frequently asked questions
Is the iOS 18.2 purchase sheet bug still a problem?
Only for users who are still on iOS 18.2 or 18.2.1. The sheet failed to appear when the key window's root view controller wasn't in the view hierarchy, for example behind a full-screen modal. It was reported fixed in iOS 18.3.
Why does the purchase hang only when the user is asked to approve it?
It isn't hanging. Ask to Buy and slow payment methods return a pending result. The finished purchase arrives later, through Transaction.updates on iOS or your purchases listener on Android, so code that only waits for the purchase call never sees it.
Can I start a purchase from a background task or a push handler?
No. The store needs something on screen to anchor its sheet: a foreground window on iOS and a foreground Activity on Android. Start purchases from a user tap while your app is visible.
Nothing happens on the Android emulator. Why?
Most emulator images have no Play Store, so billing is unavailable. Use an image with the Play Store signed in to a license tester account, or a real device.