I'm working on billing and in-app purchase procedure. My case is a one-time purchase to remove in-app ads permanently. I got working flow and I'm thinking on procedure like this:

Scenario 1 - buying app:

1. open app
2. execute on demand launchBillingFlow to buy app
4. if the app was purchased - save purchaseToken in internal storage file
5. disable ads

Scenario 2 - app was purchased and internet access is active

1. open app
2. queryPurchaseHistoryAsync - check if purchase has been done to get purchaseToken
3. read purchase token from internal file and compare with the one from point 2
  a. if tokens are different - delete internal file and show ads
  b. if file does not exist create it, put token and disable ads
  c. if tokens are equal - disable ads

Scenario 3 - app was purchased and internet access is not active

1. open app
2. queryPurchaseHistoryAsync - would not connect or would return cached info
3. check if internal file exists:
  a. if yes - disable ads
  b. if no - show ads

Scenario 4 - app was removed and reinstalled

1. on reinstall the internal file should be restored
2. apply scenario 2

Does it make sens or are there potential issues with this flow? Thank you

  • I just watched this video and got it working just in 1 hour. youtube.com/…
    – nuhkoca
    Dec 19, 2021 at 14:45


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.