I implemented successfully In App Billing using the InAppBilling-V3 library.
I have implemented all of the in app billing within my ProActivity
, once a purchase is completed successfully I set a boolean value in the shared preferences to true
.
I know that shared preferences are easily modifiable by the user, so I was looking for a way to double check from my MainActivity
if the product was purchased.
I would need basically to call
billingProcessor.listOwnedProducts()
and check that the list is != 0, but I need to do it from my MainActivity
which is not the one I implemented in app billing in.
Is there a way to achieve that? I couldn't find anything in the documentation. All of the docs do it from the activity where the in app billing is implemented.
You are right the boolean in shared preferences is unsafe and you will have to check in each activity that needs to take a decision upon billing status.
Two potential ways I'd do this.
ProActivity
and MainActivity
classes.ProActivity
and
MainActivity
classes.I prefer the second option of creating a base class but that's subjective.