in_app_purchase_watchos 0.0.1
in_app_purchase_watchos: ^0.0.1 copied to clipboard
watchOS implementation of the in_app_purchase plugin, using dart:ffi over StoreKit to query products and run purchases through SKPaymentQueue.
0.0.1 #
- Initial watchOS FFI implementation, started from a
flutter-watchos plugin portscaffold ofin_app_purchase_storekit. - Works as a normal federated implementation: apps just add this package and
use the standard
in_app_purchaseAPI.registerWith()pre-empts the app-facing package'sdefaultTargetPlatform-based selection, which would otherwise install the iOS method-channel implementation over this one. purchaseStreamonly polls StoreKit while it has a listener, and always cancels its timer — polling with nobody listening costs watch battery.buyConsumableassertsautoConsume, matching iOS, instead of silently ignoring it.- Losing the registration race is now reported via
debugPrintrather than failing silently later with an opaquechannel-error. isAvailable:SKPaymentQueue canMakePayments— the first call every app makes.queryProductDetails: StoreKit product lookup (SKProductsRequest) exposed over dart:ffi via a start/poll/read/release handle protocol.- Purchase flow:
buyConsumable/buyNonConsumable,purchaseStream,completePurchase, andrestorePurchasesvia anSKPaymentQueuetransaction observer, drained intopurchaseStreamover dart:ffi. - Upstream
in_app_purchaseexample (demo UI + officialintegration_test/) ported to watchOS; builds and passes on the watch simulator.