Giter Club home page Giter Club logo

Comments (6)

aboedo avatar aboedo commented on June 7, 2024

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.

melih-veloxia avatar melih-veloxia commented on June 7, 2024

@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.

aboedo avatar aboedo commented on June 7, 2024

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.

melih-veloxia avatar melih-veloxia commented on June 7, 2024

@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.

aboedo avatar aboedo commented on June 7, 2024

@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.

melih-veloxia avatar melih-veloxia commented on June 7, 2024

@aboedo Thanks for the update!

from purchases-unity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.