mirror of
https://github.com/defold/extension-iap
synced 2025-09-29 01:52:17 +02:00
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:
@@ -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}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user