Im trying to set up an in-app purchase to remove ads using Cranberry's Cordova iAP.. Does anyone have experience with this?
I'm most of the way there, but I can't figure out how to enable a test mode. Ive tested the purchase once, but it doesn't reset after restarting the app.. am I able to test the in-app purchase more than once? I want to test it a few times to make sure it works properly..
Or alternatively do I need to actually publish it to production and make it public for it to work? Im pretty stuck on this.. would totally appreciate any help.
Things Ive done:
-Set up a 'managed' in-app product in Dev Console (ProductID = removeads)
-Uploaded my test apk to both Alpha and Beta.
The event system in my project looks like this:
(Im using a value loaded from localstorage into a dictionary to turn the ad system on and off.)
title screen eventsheet
On Start of Layout
CordovaiAP > Add Product IDs "removeads"
CordovaiAP > Request Store listing
On request store listing Succeeded
CordovaiAP > Restore purchases (tag"removeads")
On Start of Layout
LocalStorage > Check item "removeads" exists
LocalStorage On item "removeads" exists
Dictionary > Add key "removeads" with value LocalStorage.Item.Value
LocalStorage On item "removeads" missing
Dictionary > Add key "removeads" with value=0
menu event sheet
On Start of Layout
+Has product "remove" ads
Dictionary > Add key "removeads" with value=1
Button(purchase button) > Set invisible
On touched Button(purchase button)
CordovaiAP > Purchase product "removeads"
On purchase product "removeads" success
Dictionary > Add key "removeads" value =1
Button(purchase button) > Set invisible
On purchase product "removeads" fail
Dictionary > Add key "removeads" value=0
On end of Layout
LocalStorage > Set item "removeads" to Dictionary.Get("removeads")
Main game eventsheet
On start of layout
+Dictionary "removeads" = 0 > enable ads group
+Dictionary "removeads" = 1 > disable ads group