Fix Amazon IAP: UI thread execution and post-purchase delivery#6
Draft
Copilot wants to merge 29 commits intov13.12-amazonfrom
Draft
Fix Amazon IAP: UI thread execution and post-purchase delivery#6Copilot wants to merge 29 commits intov13.12-amazonfrom
Copilot wants to merge 29 commits intov13.12-amazonfrom
Conversation
Custom test products
…cuts fix(docs): update namespace usage recommendations to avoid minificati…
Handle subscription expiration dates for determining ownership.
…onitor Note: Only check local receipts for expiry if no validator is configured
…tions (googleplay) Fix cancelled subscriptions not properly reflected in owned flag
Add support for multi-quantity purchases on Android
This change addresses Issue j3k0#1638 by: 1. Adding isAcknowledged and isConsumed properties to the VerifiedPurchase interface 2. Enhancing the Store.finish() method to check if a transaction has already been acknowledged or consumed according to the receipt validator 3. Skipping the native finish operation when server validation confirms the transaction has already been processed When a receipt verification API acknowledges or consumes purchases on the backend, the plugin will now detect this and avoid duplicate finish operations that would otherwise cause errors. For subscriptions, verified purchases are implicitly acknowledged unless explicitly marked as not acknowledged. This change maintains backward compatibility with existing validators while enabling validator implementations to include consumption/acknowledgment status in their responses. Fixes: j3k0#1638
Check https://www.iaptic.com/documentation/iaptic-js for details.
The most probable way to potentially prevent this from the plugin side is to strictly ensure launchBillingFlow is executed on the main UI thread.
Allow external code to register custom adapters without modifying the core library. This enables third-party platform support via the new Adapters.registerAdapter() static method.
- Update billing library from 7.1.1 to 8.3.0 - Use PendingPurchasesParams API (required in 8.x) - Enable auto service reconnection for better reliability - Enable pending purchases for one-time products and prepaid plans - Add support for one-time product offers (v12.0 format with InAppOffer) - Handle new QueryProductDetailsResult API in ProductDetailsResponseListener - Requires minSdkVersion 23 or higher
Co-authored-by: daedeloth <1168599+daedeloth@users.noreply.github.com>
…t-purchase flush mechanism - Wrap all PurchasingService calls (getProductData, purchase, notifyFulfillment, getPurchaseUpdates) in runOnUiThread() - Amazon SDK requires UI thread execution - Add post-purchase flush mechanism that retries delivering queued purchases to the WebView for 5 seconds after purchase completion, eliminating the need for a full app minimize/resume cycle - Fix flushPendingPurchases to re-queue purchases if listener is not yet ready Co-authored-by: daedeloth <1168599+daedeloth@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Verify Amazon IAP support in the latest changes
Fix Amazon IAP: UI thread execution and post-purchase delivery
Feb 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes proposed in this pull request:
Run all
PurchasingServicecalls on the UI thread — Amazon IAP SDK requires main thread execution, but Cordova'sexecute()runs on a background WebCore thread. OnlyregisterListener()was wrapped inrunOnUiThread();purchase(),getProductData(),notifyFulfillment(), andgetPurchaseUpdates()were not. This caused the purchase dialog to silently fail on first launch.Add post-purchase flush mechanism — When
onPurchaseResponsefires, the WebView is typically still paused (Amazon overlay transitioning away), soemitToListener()queues the data. Previously, queued purchases were only flushed ononResume, requiring a full minimize/resume cycle. Now schedules 5 retry flushes at 1s intervals after purchase completion. Also fixesflushPendingPurchases()to re-queue data if the listener is still not ready, instead of silently dropping it.To test this pull request with cordova:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.