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

@@ -77,6 +77,11 @@ static void IAPList_Callback(void* luacallback, const char* result_json)
dmScript::TeardownCallback(callback);
}
static int IAP_ProcessPendingTransactions(lua_State* L)
{
return 0;
}
static int IAP_List(lua_State* L)
{
DM_LUA_STACK_CHECK(L, 0);
@@ -210,6 +215,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}
};