IAP For iOS AND Google suddenly not working

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

Hi @antari2000 and welcome to the forums.  A couple of quick administrative notes:

  1. when posting code, please use code formatting.  That’s the blue <> button in the editing tools in the row with Bold, Italic etc. Please paste your code into the popup window.

  2. We really need to see your entire build.settings for issues like this.

Now on to the problem at hand.

When it was working:

What version of Corona were you using?

Has it ever worked with AdMob?

Has it ever worked with AppLovin?

When you say it stopped working this past week, can you be more precise on what day it stopped? I see you have code above that’s new as of yesterday (where we did make changes to Google IAP).

What other changes were made around the time it stopped working?

A quick Google search on the Android error returned several links claiming to fix this. Here is one: 

https://stackoverflow.com/questions/12812822/google-play-error-error-while-retrieving-information-from-server-df-dferh-01

A Google search on the iOS side was less revealing but it suggested logging out and back in. Apple does weird things with sandbox mode. Your testing on iOS should be done with testing accounts and you would need to log out and back in with your real iTunes account for production work.

Rob

Thanks for the welcome.  Ah, my bad, I’ll keep that in mind.  I’ll actually edit the original post so it’ll be easier to read.  

When it was working, I believe we were using build 3105 or earlier… according to when I made the downloads myself, I had 3103 installed and builds under that version of Corona had been working fine with IAP, but that’s also the same version I started experiencing this issue.  Before that I had been using 3086 (I tried building and testing with both these versions for the heck of it, and it didn’t work).  

And yeah, it had originally worked with both the applovin and admob plugins.  We’ve actually been doing a lot of updates to older apps to integrate both of these over the past month, so there are lots of builds that do have IAP working with these.

According to the timestamps of my conversations with my clients, we first experienced the issue last week, actually, July 14th in the evening.  We tried submitting a build to iOS, and they rejected it since IAP wasn’t working suddenly.  And yeah, I was going through the documentation to try to see if I could find any discrepancy or new additions, so that’s why I do have the event.init code in transactionCallback.  It actually wasn’t there in the original version that we’ve been using for some time.  

I did find that thread among my searches on the Google side though, and I tried those ideas but unfortunately they didn’t work for me. I’ll update with the results of the iOS solution as soon as I can.  Edit: I tried signing out then back in, and unfortunately it didn’t work.

The build.settings:

settings = { splashScreen = { enable = true, image = "mySplashScreen.png" }, plugins = { ["plugin.admob"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true, ["android-kindle"]=true } }, ["plugin.google.iap.v3"] = { publisherId = "com.coronalabs",}, ["plugin.applovin.paid"] = { publisherId = "com.coronalabs" }, }, orientation = { default = "landscapeRight", supported = { "landscapeRight", "landscapeLeft" }, }, android = { usesPermissions = { "com.android.vending.CHECK\_LICENSE", "com.android.vending.BILLING", "android.permission.INTERNET", "android.permission.ACCESS\_WIFI\_STATE", "android.permission.ACCESS\_NETWORK\_STATE", "android.permission.WRITE\_EXTERNAL\_STORAGE" }, }, iphone = { plist = { UILaunchStoryboardName = "LaunchScreen", -- Required! NSAppTransportSecurity = { NSAllowsArbitraryLoads = true }, CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-60.png", "Icon-60@2x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", "Icon-Small.png", "Icon-Small@2x.png", "Icon-167.png", }, }, }, }

Can you drop back to 3103 and see if you still have the issues?

Thanks

Rob

I dropped back to 3103 and to 3086 for the heck of it, and it’s still not working.

What’s strange is it seems to be initializing fine… that’s never been a problem.  So it’s able to connect to the stores and the store is able to communicate back.  But when we load the product ID(s) it always comes back in the invalid table.  So I don’t think the issue is in being able to communicate with the store?  And this is affecting all of us as well as the iTunes reviewers who kicked them back to us since they’re experiencing it as well.  

My clients have been doing this for some time, and they assure me that they’ve set up everything in their respective portals properly, and we’ve double and triple checked the IDs multiple times.  I’m not sure if there is some vague iOS or Google store change that would affect this for our builds, like, if there’s some new ‘T’ to cross or ‘i’ to dot, but it seems like there hasn’t been anything like that added lately to either iOS or Google Play.

We have made changes to the IAP for macOS and tvOS. iOS should have been unchanged in 3107.  We made a change earlier this week for the Google IAP v3 plugin that should only affect build’s 3105 and later.  If you’re using a build before that we haven’t made changes to IAP in a long time.

Are you testing against sandbox’ed testing accounts or are you making live purchases?  It’s really weird that both Google and Apple would start failing at the same time.

Rob

Apparently we got it working now.  They (my clients) created brand new apps/product ID’s in their respective stores and it works.  Random, but I’ll take it o.O  all of these updates were for older apps, so I guess that had something to do with it.  Maybe something was messed up on the iOS/Google end since they were so old?  I don’t know.  But it’s resolved.  Thanks for the help, though.  Much appreciated.

Hi @antari2000 and welcome to the forums.  A couple of quick administrative notes:

  1. when posting code, please use code formatting.  That’s the blue <> button in the editing tools in the row with Bold, Italic etc. Please paste your code into the popup window.

  2. We really need to see your entire build.settings for issues like this.

Now on to the problem at hand.

When it was working:

What version of Corona were you using?

Has it ever worked with AdMob?

Has it ever worked with AppLovin?

When you say it stopped working this past week, can you be more precise on what day it stopped? I see you have code above that’s new as of yesterday (where we did make changes to Google IAP).

What other changes were made around the time it stopped working?

A quick Google search on the Android error returned several links claiming to fix this. Here is one: 

https://stackoverflow.com/questions/12812822/google-play-error-error-while-retrieving-information-from-server-df-dferh-01

A Google search on the iOS side was less revealing but it suggested logging out and back in. Apple does weird things with sandbox mode. Your testing on iOS should be done with testing accounts and you would need to log out and back in with your real iTunes account for production work.

Rob

Thanks for the welcome.  Ah, my bad, I’ll keep that in mind.  I’ll actually edit the original post so it’ll be easier to read.  

When it was working, I believe we were using build 3105 or earlier… according to when I made the downloads myself, I had 3103 installed and builds under that version of Corona had been working fine with IAP, but that’s also the same version I started experiencing this issue.  Before that I had been using 3086 (I tried building and testing with both these versions for the heck of it, and it didn’t work).  

And yeah, it had originally worked with both the applovin and admob plugins.  We’ve actually been doing a lot of updates to older apps to integrate both of these over the past month, so there are lots of builds that do have IAP working with these.

According to the timestamps of my conversations with my clients, we first experienced the issue last week, actually, July 14th in the evening.  We tried submitting a build to iOS, and they rejected it since IAP wasn’t working suddenly.  And yeah, I was going through the documentation to try to see if I could find any discrepancy or new additions, so that’s why I do have the event.init code in transactionCallback.  It actually wasn’t there in the original version that we’ve been using for some time.  

I did find that thread among my searches on the Google side though, and I tried those ideas but unfortunately they didn’t work for me. I’ll update with the results of the iOS solution as soon as I can.  Edit: I tried signing out then back in, and unfortunately it didn’t work.

The build.settings:

settings = { splashScreen = { enable = true, image = "mySplashScreen.png" }, plugins = { ["plugin.admob"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true, ["android-kindle"]=true } }, ["plugin.google.iap.v3"] = { publisherId = "com.coronalabs",}, ["plugin.applovin.paid"] = { publisherId = "com.coronalabs" }, }, orientation = { default = "landscapeRight", supported = { "landscapeRight", "landscapeLeft" }, }, android = { usesPermissions = { "com.android.vending.CHECK\_LICENSE", "com.android.vending.BILLING", "android.permission.INTERNET", "android.permission.ACCESS\_WIFI\_STATE", "android.permission.ACCESS\_NETWORK\_STATE", "android.permission.WRITE\_EXTERNAL\_STORAGE" }, }, iphone = { plist = { UILaunchStoryboardName = "LaunchScreen", -- Required! NSAppTransportSecurity = { NSAllowsArbitraryLoads = true }, CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-60.png", "Icon-60@2x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", "Icon-Small.png", "Icon-Small@2x.png", "Icon-167.png", }, }, }, }

Can you drop back to 3103 and see if you still have the issues?

Thanks

Rob

I dropped back to 3103 and to 3086 for the heck of it, and it’s still not working.

What’s strange is it seems to be initializing fine… that’s never been a problem.  So it’s able to connect to the stores and the store is able to communicate back.  But when we load the product ID(s) it always comes back in the invalid table.  So I don’t think the issue is in being able to communicate with the store?  And this is affecting all of us as well as the iTunes reviewers who kicked them back to us since they’re experiencing it as well.  

My clients have been doing this for some time, and they assure me that they’ve set up everything in their respective portals properly, and we’ve double and triple checked the IDs multiple times.  I’m not sure if there is some vague iOS or Google store change that would affect this for our builds, like, if there’s some new ‘T’ to cross or ‘i’ to dot, but it seems like there hasn’t been anything like that added lately to either iOS or Google Play.

We have made changes to the IAP for macOS and tvOS. iOS should have been unchanged in 3107.  We made a change earlier this week for the Google IAP v3 plugin that should only affect build’s 3105 and later.  If you’re using a build before that we haven’t made changes to IAP in a long time.

Are you testing against sandbox’ed testing accounts or are you making live purchases?  It’s really weird that both Google and Apple would start failing at the same time.

Rob

Apparently we got it working now.  They (my clients) created brand new apps/product ID’s in their respective stores and it works.  Random, but I’ll take it o.O  all of these updates were for older apps, so I guess that had something to do with it.  Maybe something was messed up on the iOS/Google end since they were so old?  I don’t know.  But it’s resolved.  Thanks for the help, though.  Much appreciated.