Corona SDK IAP library encapsulated in store module receives the intent and forwards it to the listener specified in the init call like so:
store.init( transactionListener )
The transactionListener is fired after the user purchases or cancels the transaction or if transaction failed.
There are couple common dialogs that are typically presented:
Login dialog - allows the user to input their credentials before the purchase
Confirm IAP dialog - displays the IAP product price and allows the user to either buy or cancel
As it stands today there appears to be no way to execute any LUA code prior to user taking some kind of action on the above dialogs. Only after taking an action of some type the listener will fire with the state variable set to either “cancelled” or “purchased”.
With the library behaving this way it’s not possible to customize the user’s IAP “landing” experience. Whatever your application loads when it starts will be displayed. In some cases it can even show the black screen.
It would be great if Corona could add another event type ( call it promoted_iap or something similar) prior to displaying any of the IOS IAP dialogs.
Any updates on this? I’ve posted this issue in other threads and we’ve had to remove our promoted IAP in order to get our apps approved. As you know, that cuts down on our searchability since we lose the keywords in the IAP’s title.
@rob, I don’t have a copy of the rejection text from Apple but, in a nutshell, for kids apps, they expect a parental gate to open before the transaction executes.
Apple says it’s possible to detect and halt the purchase if the app opens via promoted IAP through SKPaymentTransactionObserver, but we can’t figure out how to do it with Solar2D.