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