Add transactions handler to init method according ios documentation it's important to add handler on application:didFinishLaunchingWithOptions: (https://developer.apple.com/documentation/storekit/in-app_purchase/setting_up_the_transaction_observer_for_the_payment_queue?language=objc), move observable commands to separate queue so it can be processed separately and after listener setup, add IAP_ProcessPendingTransactions function to resolve pending transactions on iOS.

This commit is contained in:
Denis Dyukorev
2020-03-04 17:26:52 +03:00
parent d6cc6f55f9
commit cbc1f659c1
3 changed files with 46 additions and 23 deletions

View File

@@ -50,6 +50,12 @@ struct IAP
static IAP g_IAP;
static int IAP_ProcessPendingTransactions(lua_State* L)
{
//todo handle pending transactions if there is such thing on Android
return 0;
}
static int IAP_List(lua_State* L)
{
int top = lua_gettop(L);
@@ -187,6 +193,7 @@ static const luaL_reg IAP_methods[] =
{"restore", IAP_Restore},
{"set_listener", IAP_SetListener},
{"get_provider_id", IAP_GetProviderId},
{"process_pending_transactions", IAP_ProcessPendingTransactions},
{0, 0}
};