How do I acknowledge an android subscription or purchase?

Hi everyone,

My app gives a chance to the user to get extra contents paying an annual subscription. Everything runs perfectly on iOS/Apple but when it comes to Google Play, users are automatically refunded after 3 days.

I wrote to Google Play Support and that’s the answer:

Thanks for contacting Google Play Developer Support.

Regarding the issue you’d encountered, if you use the Google Play Billing Library version 2.0 or newer, you must acknowledge all purchases within three days. Failure to properly acknowledge purchases results in those purchases being refunded. For purchases made by license testers, the acknowledgement window is shorter. Instead of three days, purchases are refunded and revoked if they are not acknowledged within five minutes.

Google Play supports purchasing products from inside of your app (in-app) or outside of your app (out-of-app). In order for Google Play to ensure a consistent purchase experience regardless of where the user purchases your product, you must acknowledge all purchases that have a SUCCESS state received through the Google Play Billing Library as soon as possible after granting entitlement to the user.

You can acknowledge a purchase by using one of the following methods:

  • For consumable products, use consumeAsync(), found in the client API.
  • For products that aren’t consumed, use acknowledgePurchase(), found in the client API.
  • A new acknowledge() method is also available in the server API.

I was wondering if anyone of you has experienced a similar problem and how to solve it with Thunkable.

Thank you very much for your time and help!

1 Like

Yes, this is correct and is reflected in the Google In-App Purchase documentation.

Google will give you up to 3 days to acknowledge the purchase from your side. If not acknowledged, it will be refunded to the user.

I haven’t had time to write up instructions as i’m still. waiting on user testing, But you can try this

Xano function to acknowledge and Verify Android Purchases

and this

Xano Function to Acknowledge and Verify Android Subscriptions

You’ll need to set up with your own service account details and set those in your settings page under environmental variables.

Once you get setup on xano and install these snippets, i’ll be happy to help guide you further.

You’ll need to set up your play store as indicated here also.

Screen 1 of this project shows how you can set up using xano to complete different actions
https://x.thunkable.com/projectPage/628405176085d800116f2cc6

screen 2 is based off of our academy.thunkable.com blocks and using firebase functions to accomplish the same thing.

1 Like

@Jared_Gibb the link to the android play store setup is asking me to do some google cloud setup. Do i need to do this if i’m using xano?

Because of this i got stuck at step 4.

Specifically you’ll need the service account. You open the service account file in a text editor and can then get the required keys to update your environmental variables. :slight_smile:

But yes, follow the steps even when using xano. You aren’t setting up cloud functions or code here. It’s just some (a bunch) of google settings.

The final step there is to be able to download the service key so that you can open it up and copy over some values into Xano

1 Like

What if i want to acknowlodge them manually and not automatically?
Is there a “button” on Google Play Console that allows me to just accept the subscriptions?

1 Like

This is a good question. Can you try it and see. The entry will be available in your financial page for the first 3 days but I don’t know if you can do it manually.

Hey @maurizio.polverini89, just following up here:

I was just wondering the reason you want to do this manually instead of immediately using Xano or Firebase? If you got very busy, this may be hard to keep up with and could result in lost funds.

1 Like

I myself would not store my service account key anywhere outside Google. Now Google recommends using listeners instead of polling info and I’m not sure is Xano can go with this recommendation.

The manual acknowledgement is not solution but I was wondering if it is possible. Practically, you have 3 days and if you code in your app to send you an email with every purchase then you have 72 hours to acknowledge it manually if possible.

I believe you could do this by setting up a POST or GET endpoint to accept the correct format of info (i’m imagining its a post call with a json body).

1 Like

I honestly didnt have time to look into Xano and i guess i’ll take some time to set up (it seems also pretty difficult on a first look).
At the moment I just have 1 or 2 subscription monthly on Android, by the time I study how Xano works, i’d rather acknowlodge them automatically rather than nothing.

2 Likes