store.restore()

Type Function
Return value none
Revision Release 2024.3703
Keywords Google, IAP, in-app purchases, restore
store.purchase()
store.*

Overview

Users who wipe the information on a device or buy a new device may wish to restore previously purchased items. This function initiates the process of retrieving all valid purchases and active subscriptions.

During this process, the storeTransaction listener defined in store.init() may be called multiple times, once for each item. Once completed, a transaction state "restoreCompleted" is called.

Gotchas

Unlike Apple IAP, Google IAP does not include a "restored" state for transactions. This function should still be called to retrieve all of the user's purchases, but all valid transactions will be of the "purchased" state. When you do a restore, you should treat the returned restored purchases as normal purchases, but avoid making duplicate records in your file or database — essentially, before adding a purchase, check if it already exists in your file/database or overwrite it by its key.

Syntax

store.restore()