In-App Purchasing
Ren'Py includes a high-level in-app purchasing framework. This framework
currently only supports unlock-style purchases from the Apple App Store,
Google Play, and the Amazon Appstore.
Using this framework is fairly simple, and consists of the following
functions.
- In the init phase of your game, register available purchases using the
iap.register()
function.
- Once the game has started, check to see if a purchase has been purchased
using the
iap.has_purchased()
function.
- Allow the user to purchase an item using the
iap.purchase()
function
or the iap.Purchase()
action.
- Allow the user to restore purchases bought on other devices using the
iap.restore()
function or the iap.Restore()
action.
To offer in-app purchases, the purchases (including an associated price)
must be set up on the various marketplaces. When building for android,
Ren'Py will ask for the marketplace in use when configuring the package.
- Apple App Store
- The Apple App Store is based on the package name, and does not require
special configuration.
- Google Play
- Before Google Play can be used, you must add the Google Play key and
a salt to your project. See the Expansion APK
section for information on how to do this.
- Amazon Appstore
- The Amazon Appstore is based on the package name, and does not
require special configuration.
IAP Functions
IAP Actions