iOS store.loadProducts not working

Hello!

While I’m looking at this issue, I would have several questions:

  1. Does apps currently in store (if any) still have product prices loaded?

  2. Do products refuse to load in:

  a. Xcode simulator

  b. device (debug) build

  c. downloaded from iTunes TestFlight (if you didn’t try it, give it a go)

  1. Try to call store.init() as soon as possible or insert delay before creating a new scene, to see if it would have some effect.

Hey,

Thanks for the quick reply.

  1. We have a live version in the store with the same IAP products and IAPs load with the store version which was built with 10.3.2 or 10.3.3 iOS SDK.

a, I install the app with Xcode on my device and it does not work. Can Corona apps run in Xcode simulator?

b, I always build with developer provisioning profile.

c, TestFlight has already been tried (both with production and development prov. profile)

  1. This is my last hope actually, I will try to do something about it. Do you have a suggestion on how to delay creating the scene? I would find it weird to work though, since this version of our IAPs have been live for almost a year by now and I only read about changes with the Google IAPs.

However, I’ll be in touch if I manage to work this out.

Hello!
 
I tried to reproduce behaviour you see, but cound’t. Then I tried to write super minimalistic app, and it still worked. Here’s full code of my app:
 

local y = 50

local x = display.contentCenterX

local prodList = {

    “com.coronalabs.IapTest.pc10”,

    “com.coronalabs.IapTest.pc50”,

}

local store = require(“store”)

store.init( “apple”, function(event)

    local t = event.transaction

    local rc = display.newText(t.state … ": " … t.productIdentifier, x, y)

    y = y+rc.height*1.2

    store.finishTransaction( t )

end)

store.loadProducts(prodList, function(event)

    local products = event.products or {}

    for i=1, #products do

        local p = products[i]

        local rc = display.newText(p.title … ’ ’ … p.localizedPrice, x, y)

        rc:addEventListener(“tap”, function()

            store.purchase(p.productIdentifier)

        end)

        y = y+rc.height*1.2

    end

end )

Here is some things I can advice:

  1. Try to read device console for some error output

  2. Check if iTunesConnect has some warnings near your IAPs. It is possible that Apple has some new requirements and your IAPs are not satisfy them, like screenshots or something… Product IDs may be marked as invalid for such purposes… This should be printed in the console.

Hey vlads!

Thanks for the replies. I will try these things you listed, however unfortunately in Console I can’t see any errors…

However it may be possible that my phone got messed up application-cache wise and only factory resets can fix it. It happened with one of our Ionic apps.

Once I get a solution I will post it here.

Glad to hear good news!

This is happening to us as well, in two different devices.

iPhone 7 plus, iOS 11.1.1

iPad Mini, iOS 10.3.2

Using Corona SDK 3145 and 3179, using both adhoc and distribution certificates.

loadProducts simply does not execute the listener. The store library had been working ok on these devices, and the listener does fire on other devices.

+1 

Doesn’t work on:

   iPhone X iOS 11.1.2

Does work on:

   iPhoneSE iOS 11.1.2

   iPhone iOS10.x 

Using Corona SDK 3179

since loadProducts does not trigger the listener, transactions just fail.

transaction.state = “failed”

transaction.errorType = “unknown”

transaction.errorMessage = “Cannot connect to itunes store”

All IAPs are approved and no changes have been made to them. 

Any news on this? We have huge paid advertising campaigns for Dec 15 and this just popped up.

Hello ,

I just released the first version of my game to iOS and suffer from the same problem on production - 

all my user get this error of “Cannot connect to itunes store”

i build my app with daily build version 2017.3179.

btw on google play everything works perfect,

​I am also would like to hear if there is something to do with it.

thanks, 

Barak

loadProducts is simply a way for you to get information about your products in a localized fashion. For instance, if you’re users are in Europe, you will get prices in Euros instead of US Dollars. You are not required to ever call loadProducts. It’s purely there to present your IAP’s to your users. Also, it will tell you which are valid and not.  These are not transactions and will not come into your transaction listener function.

If you try to make a purchase, that will trigger your transaction handler. Purchases are done based on a product ID. If it doesn’t work as expected, like getting an error, there is something else causing the problem.

We need to know how you’re trying to test this. Are there are other error messages in the console log that can be helpful?
 

Rob

Hello! I investigated issue, and couldn’t reproduce it. Apple IAPs indeed do not send event if load products request fails. I plan to change it in a future, but it wasn’t there for a reason: there is no clear way to say what to do in case loading products failed. Like, if it succeeds - you should render price & currency on a button. But what to do if it fails?

Doing little digging around internets, here is I found apple’s troubleshooting thingy. Not super helpful, really, but worth looking into what can cause such errors.

I see that you guys are reporting this issue on Production.

  • Does it happens every time?

  • Or occasionally for some users?

  • Or only on some specific devices?

Our IAP implementation is rather simple. It isn’t a secret, that loadProducts just creates 

SKProductsRequest, and waits for productsRequest:didReceiveResponse:. I don’t see how Corona can bork things up in this place, but if you can provide conditions or details, we would definitely investigate matters.

Thanks for the replies and clariffication,

I am currently reciving this error on production, and for all the users. I tried to search what i missed in apple configuration but come empty so far.

That sounds horrible, [member=‘barak.eliau’]! I’m sorry to hear that. Do you get it in Test Flight builds as well?

Now yes, also in test flight. Before it worked there, i will try invsetigate the logs and will update

This only happens to us on specific devices, and it seems like it is related to the internet provider.

The same device that did not work on our test environment worked on a different ISP. It just cannot establish a connection to the store, but other stuff (Downloads, webviews) work correctly. Will look further into this

I’ve published my game yesterday and I’m having a similar problem in production. The function loadProducts calls his listener, but all the products are in the “invalidProducts” array. I’ve checked many times and the product Ids are identical to iTunesConnect. When I try to make a purchase, never works, it’s not just loadProducts that is not working. Apparently it’s not finding my products on iTunesStore. The weird is that it was working on my tests a few weeks ago.

I have no idea what to do.

Make sure your products are reviewed on iTunes. You have to submit IAPs for reviews too. Not reviwed products would work in TestFlight/Sandbox, but fail in production.

Yes, they have the status “Approved” in iTunesConnect and they are marked as cleared for sale, so that shouldn’t be a problem. I’ve also sent a mail to apple’s support asking for help. If any updates I’ll let you know.