Cordova IAP buy item crashes game

Get help using Construct 2

Post » Fri Feb 03, 2017 11:59 pm

I set it so Click a button, Request Store listing and purchase product, but when I click the button it says "Unfortunately, my game has stopped."

On start of layout I have Request Store listing and Add Product ID's. And I do have the Cordova IAP added into Intel XDX and I do have the products set up in the Google Developer Console.

On start of Layout > Request Store Listing and Add products
Click button > Request Store listing and Purchase Product "Product ID"

I have Request store listing on click button in case the person isn't connected to the internet when they get to the layout. Like if they aren't connected to the internet at first, if they get connected to the internet they can click the button and the store listing can be requested then
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Sat Feb 04, 2017 6:27 pm

Bump for crash from IAP code. I did Request Store Listing, Add Products, and buy Product ID. I'm not sure why the game is crashing. and I do have it uploaded into Alpha in Google.
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Sun Feb 05, 2017 12:04 am

If it helps, here is the Crash Report from Google, When the game crashed I did a Report:

"ava.lang.IllegalStateException: IAB helper is not set up. Can't perform operation: launchPurchaseFlow
at com.smartmobilesoftware.util.IabHelper.checkSetupDone(IabHelper.java:784)
at com.smartmobilesoftware.util.IabHelper.launchPurchaseFlow(IabHelper.java:374)
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$2.onIabSetupFinished(IAP.java:278)
at com.smartmobilesoftware.util.IabHelper$1.onServiceConnected(IabHelper.java:260)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1223)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1240)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5491)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)"
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Tue Feb 07, 2017 10:08 pm

Anyone? Bueller? No one knows why the IAP is crashing the game? I did Request Store Listing, add products, and on Click buy Product. IDK why it's crashing. I know you need to request store listing and add product IDs before anything can be bought, and I did that.
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Fri Feb 10, 2017 10:22 pm

Here is the code. I modified it. Will this work?

http://imgur.com/a/P29k8
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Wed Feb 15, 2017 5:59 am

No one knows what's going on? The game just crashes. If the Cranberry IAP plugin is broken is there another IAP plugin that's compatible with Construct 2?

I do Request Store Listing and add products and it crashes. Unless i have to take out Request Store Listing and just add products.
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Thu Feb 16, 2017 3:29 pm

I've tried multiple things and nothing is worked. Even with On Start of Layout > add product and request store listing with a button that all it does it Purchase ID.

I've come to the conclusion that IAP is not possible in Construct 2. Both the IAP and Cordova Plugin are too buggy to work reliably.
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 » Thu Feb 16, 2017 5:07 pm

I know im being a pain in the @** :(im sorry. i know i am. Now i find out that with Google play there is no way to refund a one-time purchase, you have to set up as consume OR wait 14 days...... so the problem with the most recent one where the button click wasn't working for Buy could be google play ><

Turns out if you have a 1 time purchase through Google Play, there is no way to cancel to test it. As of June of last year. So someone could be testing the buy button in their app, having bought it once, and have the test purchase still active.

The way around that is to consume the product. I'm going to try a test button that consumes the product so i can buy it again to test.
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Next

Return to How do I....?

Who is online

Users browsing this forum: Syazanie Amirin and 48 guests