Okay, so this has been kind of frustrating. Myself and my two clients have started to suddenly have issues with IAP in our projects this past week, which had been originally working just fine for literally about 3 or 4 years (not exaggerating).
Some info, we are using the premium plugin for applovin and also using the admob plugin as well for ads. We’ve updated to build 3108. Speaking for myself, all software on my Macbook is up to date. We’ve tried a lot of different solutions, including factory resets on our devices and computers, even, with no luck. When we try starting up the store, it initializes fine (store.isActive is true, as well as store.canLoadProducts), but upon trying to call loadProducts, the callback data lists the product ID under the ‘invalid’ table.
Error returned on attempting to call .purchase for iOS: “Cannot connect to iTunes Store”
For Google: “Error retrieving information from server. [DF-DFERH-01]”
Our plugins table in build.settings (actually I posted the whole thing further down in this thread)
Our store code (minus fluff), the bottom 3 initialize functions are called in main depending on the store:
local finishStoreInit; local function transactionCallback( event ) local transaction = event.transaction if (event.name == "init") then finishStoreInit(); end if transaction.state == "purchased" then awardPurchase(transaction.productIdentifier); elseif transaction.state == "restored" then awardPurchase(transaction.productIdentifier); elseif transaction.state == "cancelled" then print("User cancelled transaction") elseif transaction.state == "failed" then print("Transaction failed, type:", transaction.errorType, transaction.errorString) --refunds only available in google play elseif ( transaction.state == "refunded" ) then print("refunded"); else print("unknown event") end store.finishTransaction( transaction ) end local function loadProductsCallback( event ) local validProducts = (event.products or {}); local invalidProducts = (event.invalidProducts or {}); print("VALID", #validProducts); print("INVALID",#invalidProducts); end local function purchaseUnlock() if ((storeType == "amazon") or (storeType == "google")) then store.purchase(PRODUCT\_LIST[1]); else store.purchase({PRODUCT\_LIST[1]}); end end finishStoreInit = function() timer.performWithDelay(1000, function() if (store.canLoadProducts == true) then store.loadProducts(PRODUCT\_LIST, loadProductsCallback); end end); end function initializeGoogle() store = require("plugin.google.iap.v3"); storeType = "google"; store.init(transactionCallback); --google loads on init event name now (this event name doesn't exist on iOS when we tested) --finishStoreInit(); end function initializeApple() store = require("store"); storeType = "apple"; store.init(transactionCallback); finishStoreInit(); end function initializeAmazon() store = require("plugin.amazon.iap"); store.init(transactionCallback); storeType = "amazon"; store.restore(); finishStoreInit(); end