How do I make a consumable purchase. CocoonJS, Google Play

Get help using Construct 2

Post » Wed Oct 15, 2014 9:55 pm

Hey Guys!

I've tried making a consumable type of purchase on a Construct2 game exported via CocoonJS but it's not working on Google Play.

The action called "on product consumed" asks for transaction ID, but how do i know it if the purchase isn't made yet?

Untitled.png


Untitled2.png


THANKS!
You do not have the required permissions to view the files attached to this post.
Positive, inspiring and jazzy games!



www.crystalgames.space



Enjoy!
B
17
S
8
G
3
Posts: 173
Reputation: 3,453

Post » Thu Oct 16, 2014 9:15 am

@Ludei
Positive, inspiring and jazzy games!



www.crystalgames.space



Enjoy!
B
17
S
8
G
3
Posts: 173
Reputation: 3,453

Post » Thu Oct 16, 2014 10:40 am

Hello,

In this .capx provided with the latest plugin you will find an example about it.

The expressions showed in the following picture are those ones you are missing:

Image

Expressions:
Code: Select all
CocoonJSAds.PurchaseProductId
CocoonJSAds.PurchaseTransactionId

However, it is up to you to keep them in memory if you want to consume them later.

Here is the link to the complete example:
https://github.com/ludei/Construct-2-plugin/tree/master/capx

Cheers.
B
9
S
4
G
4
Posts: 383
Reputation: 3,616

Post » Thu Oct 16, 2014 11:17 am

@Ludei Thanks for the reply!

So in the screenshot below, the item should be consumed correctly, right?
So the code will recognize the itemID and transactionID that way, because it's an action after "purchase complete" event?

Untitled.png


Or i am wrong? (sorry for my poor programming knowledge but that's why many of us use C2 ;))

P.S. IMPORTANT: I am using an outdated version of C2 because exported C2 project via CocoonJS doesn't work on iPhone 5 CocoonJS launcher. The debug shows that there are some kind of legal issues.

We really love CocoonJS and we don't really want to see it out of Construct2! Please agree you two! :) @Scirra

Thanks!
You do not have the required permissions to view the files attached to this post.
Positive, inspiring and jazzy games!



www.crystalgames.space



Enjoy!
B
17
S
8
G
3
Posts: 173
Reputation: 3,453

Post » Thu Oct 16, 2014 11:50 am

Hello,

You are writing them as Strings, delete the two " " and leave just the expressions :).
Just in case, you wrote them in the wrong box, exchange them ;).

Cheers.
B
9
S
4
G
4
Posts: 383
Reputation: 3,616

Post » Thu Oct 16, 2014 11:53 am

Ohh. Great!

Thank you very much for your quick replies!

Cheers!
Positive, inspiring and jazzy games!



www.crystalgames.space



Enjoy!
B
17
S
8
G
3
Posts: 173
Reputation: 3,453

Post » Sat Jun 06, 2015 1:00 pm

Thank You :D
B
11
S
3
G
1
Posts: 91
Reputation: 997


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, ksiads, Magistross, odiusfly, Rable and 6 guests