Chuyển đến nội dung chính

Bài đăng

Hiển thị các bài đăng có nhãn Monetization

In-app purchases in Flutter: the parts that are not about the button

The tutorial version of in-app purchases is a button, a call to buyNonConsumable , and a success callback that sets isPremium = true . Ship that and you will find out, in order: that users who reinstall lose everything, that a purchase interrupted by a phone call never completes, that a refunded user keeps their access forever, and that anyone with a modified build unlocks the app for free. None of those are edge cases. They are the normal operating conditions of a payments system. The stream is the API in_app_purchase does not work as request-response. Purchases arrive on a stream, including purchases you did not initiate in this session — restores, purchases completed while the app was closed, and purchases from a different device on the same account. final class PurchaseService { PurchaseService ( this ._iap, this ._backend); final InAppPurchase _iap; final BackendApi _backend; StreamSubscription < List < PurchaseDetails >> ? _sub; void st...