Android Question In-App Purchase

drj

Member
Licensed User
Longtime User
I am in the process of implementing an in-app purchase and have been studying the questions and tutorial quite a bit. There are a few items that are not clear at this time.
1. Routine manager_OwnedProducts(success as Boolean , purchases as map)
I assume that this routine returns Boolean success telling me that it found that I had or had not found that the current users owns an in-app purchase. For example, it there has been only one in-app purchase defined for this app in Google Play then I can assume that the user has purchased it if success is true.
Can you tell me what p.Productid is? is this a string returned from the Billing Manager giving me that name of the in-app purchase?
I assume that p.Purchased = p.STATE_PURCHASED means that the user has purchased this product although I can find no reference to p.STATE_PURCHASED in any documentation.
2. I have implemented the purchasing of the in-app purchase in another activity - I assume it is ok to reference the Main activity in calling the BillManager routines - so my call looks like this
Main.manager.RequestPayment(Main.Productid, Main.Producttype, Main.DeveloperPayload)
I have defined Productid , Productstype and DeveloperPayload as strings in Process Globals in my main routine.
Is this correct? and this leads to my third question
3. Calling Main.manager.RequestPayment(Main.Productid,Main.Producttype, Main.DeveoperPayload)
are the variables Productid , Producttype and DeveloperPayload returned from the BillingManager or do I have to supply them?
What are the definitions of these variables and how do I use them.
How can I tell that the in-app has been successfully purchased by the user? is there anything returned from this call to indicate a successful purchase
or do I have to call manager_OwnProducts again after I have made to call manager.RequestPayment

The interface seems very simple , the problem is that there is no documentation or working example to see.
Can you help me?
Thanks
Jerry
 

drj

Member
Licensed User
Longtime User
It seems that after the app with the inapp function paid for is installed on the device that the app cannot then query the products using the call
manager.GetOwnedProducts any more. What happens if the user cancels the inapp purchase? should the app be able to query the list of owned products each time it runs.

I put the manager.getownedproducts on a button and when I execute it then it returns 0 for the owned items reponse eventhough that inapp purchase was purchased already in this app.

Since we do not know what the code is the inappbilling3 library is doing , it is hard to figure why I can't query the owned products at any time. I am not sure how to this if I had more than one inapp purchase.
 
Upvote 0

tcgoh

Active Member
Licensed User
Longtime User
Hi,

Have you find a way to store paid productid in the device local database so that the purchase activity can still operated when no internet is available?

Thanks
 
Upvote 0
Top