IAP is Impossible in Construct 2

Get help using Construct 2

Post » Thu Feb 16, 2017 3:48 pm

I've come to the conclusion IAP is impossible in Construct 2. It's a pain in the @** and does not work reliably. I did On start of layout add and request. then i have a button that says on click buy ID and the button doesn't work.
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Thu Feb 16, 2017 3:50 pm

Just in case the person isnt online when the On start of layout triggers, i had the button do Request store listing and buy product, but that crashed the game. So basically internet is needed on at all times so On start of layout request catches.

Theres no way to put it in so a button requests store listing.
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Thu Feb 16, 2017 4:20 pm

java.lang.IllegalStateException: Can't start async operation (launchPurchaseFlow) because another async operation(refresh inventory) is in progress.
at com.smartmobilesoftware.util.IabHelper.flagStartAsync(IabHelper.java:821)
at com.smartmobilesoftware.util.IabHelper.launchPurchaseFlow(IabHelper.java:375)
at com.smartmobilesoftware.util.IabHelper.launchPurchaseFlow(IabHelper.java:340)
at jp.wizcorp.phonegap.plugin.wizPurchase.IAP.buy(IAP.java:348)
at jp.wizcorp.phonegap.plugin.wizPurchase.IAP.access$200(IAP.java:43)
at jp.wizcorp.phonegap.plugin.wizPurchase.IAP$3.run(IAP.java:326)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Thu Feb 16, 2017 4:28 pm

It's your code.
B
38
S
18
G
19
Posts: 664
Reputation: 14,112

Post » Fri Feb 17, 2017 3:28 am

It works! :) I tested it without Internet on till I got to the button to buy, and it still works!

With google play, you need to set up a Consume product ID. I did it with a button that on click Consume product ID. I also set up a text box that said DING (yes, ding in all caps) to made sure it worked. I had it so on Consume Product ID success, set text box with DING to visible (the box invisible to start with.)

To make sure it worked, i temporarily set on purchase ID succeed to set text box to visible :) It worked multiple times. I would do a test buy, click to consume product. After I did that, I was able to buy the product ID in a test purchase.

Google play doesn't let developers cancel test purchases from the dev. console. So i set up a Consume Product so i could keep testing it.
B
20
S
7
G
3
Posts: 302
Reputation: 3,634


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests