When performing an in-app purchase, I sent an async http request to my server to save the purchase state and use analytics.log, before performing store.finishTransaction.
There were no bugs I could notice in my developer version - all purchases were doing fine. When the app made it to the app store, the app would never get to the store.finishTransaction() line. It would log the in-app purchase (though seemingly only sometimes, I wasn’t able to figure out if this was flurry being slow or the analytics call actually not making it).
I changed my code to immediately finish the transaction, before even giving the user any items, and I’m hoping this will never result in my users not getting their in-game items. I moved my analytics and async http to after giving the user money and after finishing the transaction.
However, I would really like to understand the real reason behind this bug. Since this would only show in the release version I could download from the app store, and I can’t wait weeks to debug this, I need some capability to really analyze the situation and not just guess and throw every idea I have at this.
Why would such a situation arise? I can publish my code, but I’ve pretty much outlined the main differences between the examples in the API and my code - I use an async http request and an analytics.log call before finishing the transaction. All the other stuff I do is flipping local variables with functions that work in my application all the time, so they are all very well tested, work locally, and seem very unlikely to be able to affect anything.
The problem I’m having in my mind is I don’t know anything about the way things work internally - I don’t know how threads are used, how the async stuff is async and if there are any potential conflicts, and the documentation seems useless for situations like this. It needs to go into much more details about things that are not debuggable in the simulator - and especially things that can only be fully tested in the release - so we can reason formally about them. [import]uid: 8145 topic_id: 12343 reply_id: 312343[/import]