Replace your Product_ID variable to ProductDetails and initialize it as an empty dictionary.
In QueryProductDetails method, pass your product id as “string”.
Another Note: After Clicking Button1, Please wait for a few seconds to Let it fetch (Query) the Product Details and then click Button2.
(Complicated Approach, Skip this part if you feel you are a Beginner) Ideally in my opinion you should QueryProductDetails when the Billing client is ready & Store each of them in a Dictionary (Product Id: Details Json pair). Then when you need to LaunchPurchaseFlow for any ProductID → Get it’s ProductDetails from that dictionary by passing ProductId as key.
Hope it helps, Please skip the latter part of my suggestion if you are a Beginner, Have a nice day!
Hello oseamiya , I want this in app billing extension but can you send the pictures or videos of how to set the blocks , I only know about taifun. Thanks
How can I validate purchases made by my users in a backend securely? I want my “server” to give the product to the client instead of the client app. For this, I would need to validate whether the purchase was successfully made outside the client’s app, is there any way to check this?
PS: I did some research and saw that there is a Google API for this, but I’m finding the way to configure it very complex.
Hello,
I have tested the InAppBilling 5.0 and you can’t verify the active subscriptions withe the the call in app billing query purchase block, response block. From time to time the block detected no active subscription but in the most time also if the subscription is canceled the list in the response block isn’t empty. That must be an error.
Further problem is, after a buy from a subscription, the block purchase success and the block purchase failed with error code 6 fired but the subscription is then active.
And still a further problem, after upload the bundle to Google play console and then after download, if I then start the subscription process, the app close. After few hours it goes but with the main problem what I firs described and the other problem.
Is the Version 2 better and is this version still compatible with Google play store?
Is there in the future an update without the errors?
I tested the InAppBilling from kodular circa 1-2 months ago and the test if a subscription is active goes well but there was some errors after cancel subscription but minor. Today the same problem like with your extension. The is subscribed block doesn’t goes correctly.
Thank for an answer and if the currently available extension all don’t go correctly, is there an alternative in app billing extension with correct function?
Verifying purchases is considered a best practice when selling in-app products. For more about how to fight fraudulent purchases, check out chapter Verify purchases before granting entitlements in the Fight fraud and abuse page and chapter Processing Purchases in the Integrate the Google Play Billing Library into your app page.
After verifying the purchase, your app then needs to acknowledge the purchase.
The error I described what occurs by testing if subscription is active could be an error with mobile network. I can currently no confirm this fact but my first run for 1-2 months ago was with Wlan, now with mobile network. Today I was Wlan but I don’t test often so I can’t not say currently if this is the error.
Anyone an idea to this or the ground problem if it doesn’t comes from mobile network?
Thanks for the answer Taifun, I hope if I decided to choose another billing extension, the work well in all situations.
Hello, need help with the subscription cancelled event block:
If a user cancels a subscription, will the CancelledPurchase block get triggered? And how does one know which subscription got cancelled?
In my app there are channels that can be subscribed. I store the names of channels subscribed in a dictionary and TinyDB. I need to remove the channel name in case user cancels its subscription.
It will help me to know if the purchase token is removed from list of purchases we get from the Query Purchase block.