0 Favourites

How do I get localized product price in CocoonJS Plugin?

  • 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

  • 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.

  • 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

  • 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.

  • 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!

  • 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?

  • 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.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Thanks tringio.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)