Altova MobileTogether Designer

Query/Restore Purchases

Home Prev Top Next

The Query Purchases and Restore Purchases (iOS) buttons retrieve information about the purchases of the current user from the app store. The buttons work by executing, respectively, the Query Purchases action and Restore Purchases action. The difference between the two actions is that the Restore Purchases action, in addition to retrieving in-app purchases carried out from the app on the current device, also restores purchases made by the current user on other devices. This is a requirement of the iOS app store and has therefore entailed that a separate action be created for the purpose.

Click to expand/collapse

In our simulation, the two buttons both update the Purchases element of the $MT_IN-APP_PURCHASE page source with information relating to purchases that is fetched from the simulation data file.

Click to expand/collapse     MTDInAPExRestorePurchases

Additionally, note the following:

 

The count of purchases is updated after the Query Purchases action or Restore Purchases action is carried out, and the count is automatically updated in the display.

Since the Restore Purchases button should be available only on iOS devices, the row containing the button has its visibility made conditional on the device being an iOS device. This has been done by setting the rows's Visible property to check the value of the static variable $MT_iOS.

 

© 2017-2023 Altova GmbH