Problems with In-App Purchases using CocoonJS

Get help using Construct 2

Post » Wed Jul 17, 2013 2:38 am

So I created a game, compiled an .apk file with CocoonJS, signed and zipaligned the apk, and put it on the Google Play Store. However I've now run into an issue with trying to get In-App purchases to work.

In the Google Play Developer Console is states the following in the In-app Products tab for my game:
"Your app doesn't have any in-app products yet.

To add in-app products, you need to add the BILLING permission to your APK."

What I have attempted to do is I opened the original .apk file, added the "IInAppBillingService.aidl" file, and modified the code in "AndroidManifest.xml" by adding the line:
<uses-permission android:name="com.android.vending.BILLING" />

Then I resigned/zipaligned the whole thing and tried adding it to Google Play, but Google returned the following error:
"Your APK cannot be analyzed using 'aapt dump badging'. Error output:
Failed to run aapt dump badging:
W/ResourceType(11858): Bad XML block: header size 28257 or total size 1936025193 is larger than data size 339
ERROR: AndroidManifest.xml is corrupt"

Has anyone else had any success publishing a game using Construct 2 and CocoonJS with working In-App Purchases and can tell me what I'm missing or did wrong? Thanks.
B
6
S
1
Posts: 15
Reputation: 973

Post » Thu Jul 18, 2013 1:12 am

Looking more into this now. I would love for a more streamed line process to do this using Construct 2 + CocoonjS. This is the way to go for developers to increase revenues.
B
60
S
12
G
2
Posts: 43
Reputation: 5,574

Post » Thu Jul 18, 2013 3:35 am

Did you click to include the playstore in the Cocoon compiler?

ArcadEd2013-07-18 03:35:59
B
100
S
31
G
11
Posts: 1,552
Reputation: 21,497

Post » Thu Jul 18, 2013 4:29 am

Ah, I have not signed up for CocoonJS Extensions so I don't have access to that page.

I'll try signing up for Premium and see if it works.
B
6
S
1
Posts: 15
Reputation: 973

Post » Fri Jul 19, 2013 1:58 am

Alright so I applied and was granted Premium access, then I exported my game again, put it on Google Play and this time it let me set up In-App Products. I created a managed product with the same id name as the one I specified in Construct 2. Then I published the game.

In my game I set up some flags for if CocoonJS can access the store and if it purchases something properly. The first part worked fine and it seems that my game was able to connect to the online store, however upon pressing the "buy" button, my purchase failed flag is triggered.

My Events in Construct 2 basically goes like this:

Touch| On touched button: CocoonJS| Purchase product "id" with preview
CocoonJS| On "id" purchase completed: Text| Set text to "Purchase Completed"
CocoonJS| On "id" purchase failed: Text| Set text to "Purchase Failed"

Upon pressing the button, no preview or anything pops up. The text simply displays "Purchase failed"

Did I miss a step? Or does my id name have to be something more complicated?Suikama2013-07-19 01:59:15
B
6
S
1
Posts: 15
Reputation: 973

Post » Sun Jul 21, 2013 10:28 am

I have the same problem on my game, any help?
B
15
S
3
G
3
Posts: 37
Reputation: 3,627

Post » Tue Sep 03, 2013 9:12 pm

As anyone solved this issue? Also, can someone post an example of how to do in app purchases with CocoonJS.
B
42
S
9
G
7
Posts: 58
Reputation: 7,485

Post » Sat Sep 21, 2013 6:49 am

Has anyone solved this problem yet ?
B
11
S
4
G
3
Posts: 2
Reputation: 3,927



Return to How do I....?

Who is online

Users browsing this forum: menos30, mercuryus, RetroSpock, TRMG and 12 guests