How do I get localized product price in CocoonJS Plugin?

Get help using Construct 2

Post » Mon Jun 16, 2014 3:14 am

Hi to all
I have a question...
in my C2 game I use CocoonJS plugin (new open source plugin)
I have one In-App purchase and all work fine...
I can successfully made IAP work on iOS sandbox, but can't get localized product price by this function (expression):

CocoonJS.ProductLocalizedPrice(Index)

What the "index" means?
I try to put (instead of index) the name of my productID but not work, I try to put a number (0 or 1) but not work....
the string value get nothing returned
How can I show ProductlocalizedPrice by TEXT object?

please help me!
thank's
B
16
S
4
Posts: 248
Reputation: 2,267

Post » Mon Jun 16, 2014 4:00 am

I think i figured it out ,

After the event , "On Products Fetch Completed" ===> Call "Update Product List"
Then get the value of , CocoonJS.ProductLocalizedPrice(0) or CocoonJs.ProductPrice(0) or whatever details you wanted to get out of the product data.

I wish they have a better documentation and good working example to demonstrate all the features similar to the one working in a real game.
B
16
S
4
Posts: 248
Reputation: 2,267

Post » Mon Jul 07, 2014 4:19 pm

Hi there,
I will be wanting to implement an IAP in my game shortly
could you post your successful process to help those of us out that have never ventured down these paths? ;)
many thanks in advance!
Carlos
cjuliao
- Father
- Tree Hugger
- Designer, Animator & Game Developer
B
13
S
2
Posts: 56
Reputation: 1,558

Post » Wed Jul 09, 2014 2:59 am

Just follow this process here : https://github.com/ludei/Construct-2-plugin , you need to create a CustomLauncher to test your IAP from Ludei Cloud Compiler.
B
16
S
4
Posts: 248
Reputation: 2,267

Post » Wed Jul 23, 2014 10:37 am

I've been trying to figure this out for a couple days now. Can't believe it was as simple as adding the "Update Product List" action after the fetching is completed.

Thanks!
B
7
S
1
Posts: 25
Reputation: 477

Post » Mon Aug 18, 2014 6:25 pm

Thanks for the pointer.
Could anybody give me a hint on how the CocoonJs.ProductPrice are indexed? I tried to CocoonJS.Fetch("product3,product2,product5,product1, product4"), and I have the following:

CocoonJs.ProductPrice(0) gives the price of product5
CocoonJs.ProductPrice(1) gives the price of product4
CocoonJs.ProductPrice(2) gives the price of product3
CocoonJs.ProductPrice(3) gives the price of product1
CocoonJs.ProductPrice(4) gives the price of product2

I have no idea how they are arranged. Is it just random? Or have anything to do with the order you create/edit a product?
B
8
S
2
Posts: 22
Reputation: 571

Post » Tue Aug 19, 2014 5:00 pm

It's the same order how you create in itunesconnect. you need to tweak the order in the itunesconnect to get it right the kind of order that you are looking to used in your app.
B
16
S
4
Posts: 248
Reputation: 2,267

Post » Tue Aug 19, 2014 7:41 pm

Thanks tringio.
B
8
S
2
Posts: 22
Reputation: 571


Return to How do I....?

Who is online

Users browsing this forum: stevenode and 11 guests