Here's our code for in-app purchases:
Code: Select all
init:
$ iap.register("dom_route",identifier="com.argentgames.redembrace",google="com.argentgames.redembrace")
$ iap.register("isaac_route",identifier="com.argentgames.redembrace",google="com.argentgames.redembrace")
$ iap.register("rex_route",identifier="com.argentgames.redembrace",google="com.argentgames.redembrace")
$ iap.register("full_game",identifier="com.argentgames.redembrace",google="com.argentgames.redembrace")
$ iap.register("android.test.purchased",identifier="com.argentgames.redembrace",google="com.argentgames.redembrace" )
Code: Select all
screen dom_purchase:
tag menu
zorder 10
modal True
imagemap:
ground "gui/micro.png"
idle "gui/micro.png"
hover "gui/micro.png"
hotspot (347,334,585,62) action iap.Purchase("dom_route", success="[jump dominic, Hide('dom_purchase')]")
hotspot (347,464,585,62) action iap.Purchase("full_game", success="[jump dominic, Hide('dom_purchase')]")
hotspot (347,592,585,62) action MainMenu()
Code: Select all
imagemap:
ground "gui/card_idle.png"
idle "gui/card_idle.png"
hover "gui/card_idle.png"
hotspot (979,21,301,111) action ShowMenu("profiles")
# if iap.has_purchased("dom_route") or iap.has_purchased("full_game"):
# hotspot (959,496,283,206) action ShowMenu("already_purchased")
# else:
hotspot (959,496,283,206) action iap.Purchase("android.test.purchased")
Code: Select all
define build.google_play_key = "XXXXXXXX ... XXXXX"
define build.google_play_salt = (X,X, ... , X)