Open CyrilNb opened 7 years ago
Once billing processor gets initialized, you can check it like this :
TransactionDetails transactionDetails = billingProcessor.getPurchaseTransactionDetails(productId);
if (transactionDetails != null) {
//Already purchased
//You may save this as boolean in the SharedPreferences.
}
Thanks, I'll try this out.
@Ashish-Bansal
Your above code can use for case no internet?
The above code worked for me with internet access. I guess .getPurchaseTransactionDetails retrieves information from internet.
@nguyencongbinh I'm not sure about that but it should work without internet too as this library is just acting as a wrapper and Google Play Services most probably would be caching/storing purchase transaction details.
@CyrilNb Did you tried this solution? #244
It worked for me.
@Ashish-Bansal is there any way to check the expiry date of the subscription ?
TransactionDetails transactionDetails = billingProcessor.getPurchaseTransactionDetails(productId); will this method return false for canceled Transactions?????
Hi,
It's not totally clear on how to check if a user owns a product. I mean, I implement the way to buy a product by calling "bp.purchase(productID)" in my app but then when I restarted the app, It should have check at the beginning if "productID" is already owned, and then do something (which is set up a new layout without any ads on it).
I used the method billingProcessor.isPurchased("productID") in my oncreate method and then set my layout without ads if boolean returned is true.
But it's not working. Is there something I missed ? How do you guys retrieve a owned product ?