Comments (8)
That said, if the purchase is PENDING
, you'd only get purchaserInfo
updated, but no callback.
We're trying to figure out how to improve that behavior (RevenueCat/purchases-android#160), since it's not ideal. See that ticket for details
from purchases-flutter.
Well, while workaround "call purchasePackage -> store flag somewhere if PENDING -> assume that particular purchase has finished" can theoretically work but it is not 100% bullet proof.
User can make few purchases in a row, so after receiving purchaserInfo there is no way to know which feature to unlock (except storing previous state of purchaserInfo and comparing what changed on every update).
Adding some kind of purchase life-cycle event stream would give a developer flexibility to implement almost any kind of purchase workflow he wants.
from purchases-flutter.
agreed. moving this to backlog since we'll integrate the fix as soon as we do it on purchases-android
. However, I don't know when we'll get to tackle it since we have other items on our plate.
from purchases-flutter.
you're correct, the listener will only get a value for the updated purchaserInfo.
The purchasePackage
and purchaseProduct
methods, however, do optionally send an error.
If there's no error, you should be able to assume that the purchase went through correctly. If there's an error, it might be due to a user cancellation. The methods also throw a PlatformException
if the purchase was unsuccessful.
from purchases-flutter.
The issue here is that in case of slow purchases payment can go through/fail after few minutes. User can navigate away from the paywall to all different sorts of pages where getPurchaserInfo is called.
And now there is no way to tell why PurchaserInfoUpdateListener was triggered - was it because purchase went through (and which one for that matter) or subscription expired, or some other purchase was made on other device.
PS. Thank you guys for this lib and RevenueCat in general - the service is just great! I was fighting with official flutter plugin for few days - it is such a buggy mess! Then I found RevenueCat and implemented the whole thing in few hours.
from purchases-flutter.
PS. Thank you guys for this lib and RevenueCat in general - the service is just great! I was fighting with official flutter plugin for few days - it is such a buggy mess! Then I found RevenueCat and implemented the whole thing in few hours
You made my day 😃
Thinking about your case:
yeah, from the listener you wouldn't have a way to find out why the purchaserInfo
got updated. And the listener itself doesn't contain the error messages either.
So you would delegate all of that to the completion block of purchasePackage
| purchaseProduct
.
So when that specific function is called (the completion block of the purchase method), you know, no matter where your app is, that it was called after receiving information about the status of the purchase, and you can react from there. You'll get the latest purchaserInfo
as a param of the callback, as well as an error if one occurred.
from purchases-flutter.
Is there any workaround for handling these pending payments? I am also running into this.
from purchases-flutter.
You should be able to detect a pending payment when it occurs through a specific purchase error, but there isn't an officially supported way to determine if there is a pending payment from the PurchaserInfo object.
We have this on the backlog, and would like to develop a solution that works cross-platform since there are pending purchases on iOS as well. Since this is really a backend API feature and not a specific Flutter SDK issue I'm going to close this out for now.
from purchases-flutter.
Related Issues (20)
- CustomerInfo listener fires with stale data HOT 3
- presentPaywallIfNeeded isn't defined. Using 6.3.0-beta.1 HOT 10
- Crash on SDK for the iOS app - PurchasesHybridCommon HOT 4
- Sample app does not call Purchases.removeCustomerInfoUpdateListener HOT 2
- The await for CustomerInfo customerInfo = await Purchases.purchasePackage(myProductList[index]); never completed; MagicWeather example, v.6.3.0 HOT 5
- Offerings not found or Null HOT 13
- Expand with linux, windows and more HOT 2
- Product Localization Problem For AppStore HOT 2
- presentPaywallIfNeeded always return Null HOT 6
- iOS simulator checkoutl HOT 9
- Dismissing iOS payment sheet throws uncatchable error HOT 3
- App rejected because no prices available in the TestFlight version but available in the AppStore version HOT 7
- Do you have example code for new paywall system? HOT 2
- Fatal Crash when using Flutter 6.3.0-beta.2 Paywall HOT 8
- What is public_ios_sdk_key ? HOT 4
- productPlanIdentifier parameter missing from EntitlementInfo HOT 2
- logOut() throws "user is anonymous" error even if I check Purchases.isAnonymous first HOT 5
- CustomerInfo == / hashCode aren't working HOT 3
- late initialization crashes the app HOT 3
- RevenueCatUi.framework is 4 MB in my executable for iOS, and I do not even use it, wassup? HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from purchases-flutter.