So, I'd like to have the option to pay .99 and remove ads on my app (android, crosswalk, official IAP plugin).
I've gotten everything to work, except...when you buy the product (ad_remove) the ads are not removed. It is a managed product, not consumable, so as I understand it you should be able to use "restore purchases" and always remember that you've bought it--is that right?
My app is connected to Google just fine, I think--my test order goes through, no error messages, so I must have something set up wrong in Construct 2.
To remove the ads, I have the following code:
On start of layout:
->add product IDs "ad_remove"
->request store listing
->restore purchases
then as sub-events:
System global variable noAds=0 ->preload/show banner, etc--this all works--too well!
else-> [I left this empty, which I think should mean no ads are loaded or displayed if the variable is 1?]
and:
IAP has product "ad_remove" -> set noAds to 1
My "buy" button looks like this:
On tap "remove ads" sprite
sub event IAP is store available ->request store listing [do I need this?]
->purchase product "ad_remove"
Below that:
IAP on product "ad_remove" purchase success
->restore purchases [do I need that there?]
->"buy ad" sprite destroy [which doesn't work--it hasn't been destroyed, though it has become unclickable now that I've purchased the product]
->system set variable noAds to 1
->hide banner ad [which would be showing at the time of the purchase]
On the actions that potentially trigger an interstitial I have things set up like so:
Trigger
sub events:
System global variable noAds=0 ->trigger ad, ad plus perform action, etc [this all works as it should]
else-> blank, or just the action with no ads
I manually changed the noAds variable to 1 to make sure I'd caught all the possible ad triggers, and I had--so somehow the variable and IAP "has product" information is just not getting changed.
Do I have events out of order? Am I missing something in how to set up in app purchases or call previous purchases? Or is it something that doesn't work in alpha/beta testing but would work once the app is actually published? (Which is a chance I don't want to take unless someone assures me that's the case!)
I'll continue testing things and trying to work out the problem, but if any more experienced people have suggestions or could point out where I've gone wrong, I'd greatly appreciate it!