What can I do to keep the user's purchases saved?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By maxiproduksiyon

I ran the above example on my cell phone. I became a test user. test Purchase completed. What should I do next? What can I do to keep the user’s purchases saved? For example, an ad removal request or an item purchased. What should I do so that the ad does not appear again or the item I bought always appears in the game?

:bust_in_silhouette: Reply From: maxiproduksiyon

I guess this place is deserted.

:bust_in_silhouette: Reply From: yrtv

It’s not. But nobody understands why would you want to save user purchases somewhere.

If You want to save user purchases somewhere then save dictionary returned by queryPurchases().

If you think you must save user purchases yourself for iap to work you don’t Google does.

You must request purchases from Google with queryPurchases() on app start or user login (depending on your app)

Read full documentation here: Android in-app purchases — Godot Engine (stable) documentation in English

To be fair, one might want to save a purchase by themselves in order to make such purchase work, even if the player is offline.

Weslley Al | 2021-02-04 16:08