in-app purchase issue (iOS + cocoonjs)

0 favourites
From the Asset Store
Shark.io
$49 USD
Shark.io in the sea full of killer sharks, Sunday of life is the game. Who knows what is happening under the sea?
  • Restore can't work. I've looked at their code for the C2 plugin and I know why restore has never worked.

    On Purchase Completed triggers Consume Purchase for Android & Finalize Purchase for Apple.

    Both of these tell the server your item is consumed, gone from the queue/account. So Google/Apple cannot restore it.

    The On Purchase Completed trigger should be split into TWO types, 1 for unmanaged consumables and another for managed non-consumable that doesn't trigger consume/finalize.

    The reason Ludei's own apps work with consume is they don't make it with C2, they control their IAP triggers manually.

    I'm using cranberrygame's IAP plugin for XDK and he has trigger for unmanaged & managed with a consume trigger that you call in yourself manually when required. Restore works if you do not consume the item.

  • silverfox russpuppy

    I try yesterday to restore my purchase and it work on my game

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • silverfox russpuppy

    I try yesterday to restore my purchase and it work on my game

    Did you use an updated plugin?

    Because the one in C2 definitely calls to consume & finalize every purchase, so its not possible to restore.

    This is from the runtime.js of CJSAds plugin in C2

    [attachment=0:26ts8irq][/attachment:26ts8irq]

    Unless Ludei updated to change it, would be nice to be informed by them... but didn't see anything.

  • I use the open source plugin but not the master plugin I had downloaded the "restore purchase" plugin

    Fortunately in my game all IAP works (consumable and non) and the restore purchase work too.

  • I use the open source plugin but not the master plugin I had downloaded the "restore purchase" plugin

    Fortunately in my game all IAP works (consumable and non) and the restore purchase work too.

    Okay that makes sense.

    I got the master plugin and it never worked, nor does the default one from C2. So it looks like the open source people have fixed it by removing the call to consume/finalize!

  • From what I could see, the branch of Restore Purchase was deleted, and there were no updates on the master plugin, so I doubt it has come to a solution.

    Here's the link to check:

    https://github.com/ludei/Construct-2-pl ... -purchases

  • I used that branch of the plugin and my restore purchase work well.

  • Looks like that branch isn't there anymore, looks like maybe they've merged it master? Also looks like they've updated the github issue notes, they say it's fixed now: https://github.com/ludei/Construct-2-pl ... t-54051675

    I'll be testing today, will let you know how it goes

    edit: having issues with Spriter + CocoonJS, so I can't really test until I get this worked out

  • russpuppy I just got that updated plugin, looking at the code, they definitely fixed it.

    It's now broken down to separate commands which you can call to consume an item or not, depends on whether its consumable or permanent. Once consumed, it cannot be restored.

  • according to this restore purchase has been fixed -> https://github.com/ludei/Construct-2-plugin/issues/16

  • according to this restore purchase has been fixed -> https://github.com/ludei/Construct-2-plugin/issues/16

    Yup I just confirmed its fixed in the post above.

    Their code is separated so that consume isn't auto-called like it has been forever.

  • gonzdevour I have been in contact with apple support for more information. They told me that I have created the IAP purchase but did not submit with my latest build. I'm not sure if this was an old requirement or if it's a new one with the latest UI. In any case I am now hopeful that it will go through this time.

  • gonzdevour I have been in contact with apple support for more information. They told me that I have created the IAP purchase but did not submit with my latest build. I'm not sure if this was an old requirement or if it's a new one with the latest UI. In any case I am now hopeful that it will go through this time.

    They meant you have to make IAP status from "Developer Action Needed" to "Waiting for Review" after being rejected? I am sure I always checked the items all before 3 times submitting.

    (If the IAP status stays in "Developer Action Needed", sandbox mode will also fail to purchase. I had always tested sandbox mode once before submitting, so I am sure that IAP status was ready.)

    I am thinking about the difference between these 2 purchase failed events:

    -on purchase failed(product ID)

    -on consume purchase failed

    I used "on purchase failed(product ID)" to detect if showing failing message,

    and I'm curious about if there're something wrong on it.

  • gonzdevour My IAP has always said "Waiting for review" for me too, but it appears you (perhaps just updated this way) have to add them to the main app page in the new itunes connect UI. However, perhaps this is just requirement of the new system? I hope I wasn't rejected because the system changed while I was waiting for review...

    Anyway I do the following:

    On an upgrade button I have the following.

    Is store available? => Fetch those products from store: "app"

    Then I have the following to complete the process.

    On product fetch complete => Purchase product "app"

    On 'app' purchase completed => [Give them the full version]

    On 'app' purchase failed=> [Show failed visual events]

    Is product 'app' puchased? => [Give them the full version]

    What about you?

  • TheWyrm

    I don't use "is store available" event I think this can be the cause of the problems.

    I write here my event for the IAP (with CocoonJs opensource plugin):

    on start of layout (where my iap button is) > fetch products from store (and I put the IDname of my product)

    on product fetch complete > update product list (because I need to take the "localizedPrice" of my product)

    on touched buy button > purchase product (and the IDname of my product)

    on purchase completed > set the variable buymyproduct = 1 and set the variable purchaseerror =0

    on purchase failed > set the variable purchaseerror =1

    then I check my variables and I unlock all levels if bymyproduct is 1 or show error message if purchaseerror is 1

    thats all

    this way my game was published on the applestore and my iAP works fine.

    I hope I was helpful

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