Question

I'm having an issue with my corona SDK InApp testing(iOS only). I've a page to purchase a character. First time if I buy a product, it is working good. But if I do the following steps:

  • Remove the app from the device
  • Click cancel button in the buy-cancel alert (fig1.1). This will trigger: event.transaction.state == "cancelled". (This cancel click is just done for explaining triggering case, that I am describing below)
  • Then I came back to the scene again and clicking the buy button of fig 1.1, It will show an alert as in fig 1.2. I think it means it will automatically restore the app. But above all my expectation, it triggered the same method, that is: event.transaction.state == "cancelled".

enter image description here Fig 1.1

enter image description here Fig 1.2

Problem: I am unlocking the item by writing it to a file when it is either purchased/restored. I think, when I reinstall the app, restoration has to be take place. But it is triggering cancelled. So how can I unloack the item. Pls, pls help me. Any suggestion is valuable...

Était-ce utile?

La solution

It seems like the store transaction wasn't finished properly the first time.

Did you make sure to call the following code in your transaction callback ? Even if the transaction is cancelled you need to finish it to let the store system know that you have processed the cancel:

store.finishTransaction( transaction )
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top