Solved

Purchase process in Unity3D SDK

  • 1 August 2023
  • 2 replies
  • 46 views

Badge +6

How should purchasing process looks like in Unity3d? 

 

In official docs Unity (revenuecat.com) we see only single function for this purpose:

public void BeginPurchase(Purchases.Package package)

 

I think it’s definetly lack of documentation. How should we obtain Purchases.Package object? Create it from new on our own? Get it somehow and store it?

icon

Best answer by Ryan Glanz 3 August 2023, 16:41

View original

2 replies

Badge +6

Ok I think the right process is to fetch offerings, get current offering and store it in some variable. Then just get packages from current offering and use it as an argument for the PurchaseProduct function.

 

I think it’s good to add such info in docs. Or at least make docs in github so anyone can pull request addition to them.

Userlevel 3
Badge +8

> Or at least make docs in github so anyone can pull request addition to them.

We have added our docs to github and will be making them public soon 👀

 

And yes, that is how to fetch the packages. We have that in our general instructions here: https://www.revenuecat.com/docs/displaying-products#fetching-offerings (which also has some Unity code if you’d like)

 

Reply