Comments (6)
hi @melih-veloxia!!
When a purchase is finished outside of the regular flow (i.e.: if there's a problem with the card, or if the user has to ask for parent's permission for a purchase, etc), the SDK will still provide a callback to the app.
This is done through the PurchaserInfoListener
. Here are our docs explaining how to use it.
Basically in Unity you just make sure that you override the method PurchaserInfoReceived
in the class that inherits from Purchases.UpdatedPurchaserInfoListener
, then react to changes when the method gets called.
Hope this helps!
from purchases-unity.
@aboedo We managed to use this method but this method returns purchaserInfo
what is your suggestion to determine which in app purchase is completed outside the game? Additionally, this listener is triggered when there is a purchase "inside" the game. That's why we decided to save a boolean variable if userCancelled
is false and there is a STORE_ERROR
. We check that boolean inside Purchases.UpdatedPurchaserInfoListener
but this neither a bulletproof nor a solid method.
from purchases-unity.
purchaserInfo
has information about entitlements, which in turn has information about the products the user has purchased.
We don't however have a specific way to know exactly which purchase just went through, sadly (this is in our backlog).
So the method you described (setting up the listener, then when the app is ready to do something with the purchased content, checking the value of purchaserInfo
) should work.
Are there particular use cases that you're concerned about that wouldn't be covered by this?
from purchases-unity.
@aboedo entitlements returns only subscriptions, not the in-app-purchases. To check the in-app-purchases, I may use nonSubscriptionTransactions
. To handle these kind of situations perfectly, I need to parse both entitlements and nonSubscriptionTransactions
into our local database and check the latest ones, match it with the latest failed one, then mark them as rewardGiven to avoid reward duplication. It is such a huge process that I deeply feel like we shouldn't handle it on our own side to make it perfect as RevenueCat is a very well paid tool.
Please let me know in case there is an easier solution I missed.
from purchases-unity.
@melih-veloxia I agree with you that this is something that RevenueCat could and should handle.
We have it in our backlog, however I don't have an ETA.
In the meantime, the solution you described is as good as it gets, I'm afraid.
Hope that makes sense
from purchases-unity.
@aboedo Thanks for the update!
from purchases-unity.
Related Issues (20)
- error CS1525: Invalid expression term '>' HOT 5
- AmazonStore: "There as a problem with store. Code 2, UnderlyiningErrorMessage: Failed to get user data." HOT 11
- Unable to resubscribe after expiration in TestFlight/sandbox environment (many related posts before without a solution) HOT 16
- Receive Customer Info Bug HOT 3
- Purchases framework causes crash on older iOS devices HOT 14
- productIdentifier null or empty in Purchases.PurchasePackage callback HOT 2
- Null error when i am setting a app user ID HOT 4
- Add issue templates
- Game Crashes on Start (Android) HOT 1
- Random login errors HOT 4
- Trying to understand entitlements - Not a bug HOT 2
- Unity PostProcessBuild scripts for Xcode HOT 3
- 3.5.0 Version NoSuchMethodError getSkus() HOT 5
- 📣 Have a question? Please use https://community.revenuecat.com 😁 HOT 1
- Unable to distribute to App Store Connect, Invalid bundle HOT 11
- RevenueCat Purchases SDK doesn't get initialized HOT 4
- Crash when not setting `deprecatedLegacyRevenueCatAPIKey` on simulator HOT 4
- Issue within BillingClient 4.0 - SkuDetails missing freeTrialPeriod HOT 1
- `namespace Editor` for Unity/iOS colliding with UnityEditor.Editor
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-unity.