Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

IAP not working correctly with Corona-2019.3528 and IOS 13
Started by accounting7 Sep 24 2019 08:34 AM

75 replies to this topic
[TOPIC CONTROLS]
Page 2 of 4 1 2 3 4
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#26

pixec

[GLOBAL: userInfoPane.html]
pixec
  • Contributor

  • 166 posts
  • Corona SDK

Simplest approach is to create a local json file that you store events to. Then at your discretion you send the data to your server. When youve received the data on your server you send a message back to the app that the data was received. Then you can delete the local data and store new events. There are tons of ways to so this.

[TOPIC: post.html]
#27

d.mach

[GLOBAL: userInfoPane.html]
d.mach
  • Contributor

  • 956 posts
  • Corona SDK

I tried your solution. When trying "restore purchases" the app crashes immediately.
I was using the latest iPad Pro running iPad OS 13.1.3.
Corona version is 2019.3547 and iOS SDK 12.4. There is no error message in device log.
Anyone knows what's going on?

 

Is this working now? I have to do some updates soon and don't want to break working apps. :P



[TOPIC: post.html]
#28

colinmorgan

[GLOBAL: userInfoPane.html]
colinmorgan
  • Enthusiast

  • 45 posts
  • Corona SDK

My experience with 3555 targeting 13.2 is that IAP has become somewhat unreliable.

On devices running iOS 9, when I make a purchase I get success about half the time, and crashes the other half. It is not related to what I try to buy- things that worked five minutes ago will suddenly crash.

On devices running iOS 11 or better, everything works great for me and my testers, but I just got an App Store rejection because half of the IAP returned "Transaction Failed - No response from the app store." on the tester's device. (iPad running 13.2)

I'm using IAP Badger, which has been working great for a long time and I haven't made and changes since the last update other than add additional puzzles (no new IAP) so it feels like this is some hiccup between the new Apple IAP plugin and 13.2.

Does anybody have any insight?



[TOPIC: post.html]
#29

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,615 posts
  • Enterprise

There was another thread where Vlad chimed in that this appears to be a timeout issue with Apple's IAP servers. Some transactions just take a very long time for some reason and we have little insight into the cause.

 

Rob



[TOPIC: post.html]
#30

GamingStudio17

[GLOBAL: userInfoPane.html]
GamingStudio17
  • Contributor

  • 185 posts
  • Corona SDK

What to do? On iOS 13.2.3 does not work. When checking, apple writes the following:

We found that your in-app purchase products exhibited one or more bugs when reviewed on iPad running iOS 13.2.3 on Wi-Fi.
 
Specifically, no action occurred when we tapped on your in-app purchases.

 

 



[TOPIC: post.html]
#31

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,615 posts
  • Enterprise

Are you testing on an iOS 13.2.3 device?

You can add debugging print statements and get them from the device's console log.

 

Without that, there is very little anyone can do to help you with this. If you don't have a device to test on, you can use TestFlight and see if another developer can help you find the problem.

 

Rob 



[TOPIC: post.html]
#32

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Corona Geek

  • 1,374 posts
  • Corona SDK

I just purchased something from my 10.2.3 device from one of my apps. And it worked as expected. That particular app was built with 2019.3540

[TOPIC: post.html]
#33

GamingStudio17

[GLOBAL: userInfoPane.html]
GamingStudio17
  • Contributor

  • 185 posts
  • Corona SDK

Are you testing on an iOS 13.2.3 device?

You can add debugging print statements and get them from the device's console log.

 

Without that, there is very little anyone can do to help you with this. If you don't have a device to test on, you can use TestFlight and see if another developer can help you find the problem.

 

Rob 

We are testing iPad running iOS 13.2.3 on Wi-Fi and everything works. There are no errors in the console, everything is fine. But Apple writes that the error and the purchase does not work, for a couple of days now we can’t understand what the problem is.



[TOPIC: post.html]
#34

colinmorgan

[GLOBAL: userInfoPane.html]
colinmorgan
  • Enthusiast

  • 45 posts
  • Corona SDK

I am having a similar problem- IAP works fine for testers, fails in App Review- and I reached out to a member of Apple's Developer Technical Support staff who was kind enough to give me a few minutes of his time without my having filed an official Technical Support Incident. We determined that the SKProductRequest call was successful. (I could see that localized pricing was being displayed in the screenshot that accompanied the rejection.) He felt that the most likely culprit was that the app was not correctly validating the appStoreReceipt and directed me to an Apple Technical Note that included the very prominently statement: "Important: The App Review team reviews apps in the sandbox."

This makes me wonder if the trouble we're experiencing is that receipt validation is happening correctly for Production, but not for the Sandbox?

I did a build in October that passed App Review, and I can't pass now.



[TOPIC: post.html]
#35

GamingStudio17

[GLOBAL: userInfoPane.html]
GamingStudio17
  • Contributor

  • 185 posts
  • Corona SDK

So at the moment we can build using Corona 2019.3476 targeting iOS SDK 12.1 and this should solve the problem?



[TOPIC: post.html]
#36

colinmorgan

[GLOBAL: userInfoPane.html]
colinmorgan
  • Enthusiast

  • 45 posts
  • Corona SDK

That's what I thought, but a build I submitted last week made with Corona 2019.3476 targeting iOS SDK 12.1 was rejected. That said, go ahead and give it a go- you've got nothing to lose except 15 minutes out of your day.



[TOPIC: post.html]
#37

GamingStudio17

[GLOBAL: userInfoPane.html]
GamingStudio17
  • Contributor

  • 185 posts
  • Corona SDK

colinmorgan, yes, you're right, the same thing did not help :(  Rob Miracle we all need your help. I asked the console log from the apple until I received a response. Thank you.



[TOPIC: post.html]
#38

GamingStudio17

[GLOBAL: userInfoPane.html]
GamingStudio17
  • Contributor

  • 185 posts
  • Corona SDK

Apple magic has happened today and our Draw Rider Plus game has gone through a review. Yesterday, Apple wrote the same thing that nothing works, I wrote to them that the game was made in the Corona SDK. And today, lo and behold! Game released :)
https://apps.apple.com/us/app/draw-rider-plus/id629059031



[TOPIC: post.html]
#39

colinmorgan

[GLOBAL: userInfoPane.html]
colinmorgan
  • Enthusiast

  • 45 posts
  • Corona SDK

That's great news! I'll try the same thing. Can you be more explicit about what you wrote?

Also, what Corona build did you use, and which iOS version did you target?



[TOPIC: post.html]
#40

GamingStudio17

[GLOBAL: userInfoPane.html]
GamingStudio17
  • Contributor

  • 185 posts
  • Corona SDK

That's great news! I'll try the same thing. Can you be more explicit about what you wrote?

Also, what Corona build did you use, and which iOS version did you target?

Corona 2019.3476 targeting iOS SDK 12.1.
Can you write an error log? This will help a lot. The game is made in corona sdk. We are trying to solve the problem with the developers of the engine. Thanks.
At first the review did not go through. And then they wrote nothing and the game went through a review :)



[TOPIC: post.html]
#41

GamingStudio17

[GLOBAL: userInfoPane.html]
GamingStudio17
  • Contributor

  • 185 posts
  • Corona SDK

We managed to get through the review of apple with the game Draw Rider. For this, we used the stable version of CoronaSDK 2018.3326 and the latest xcode 11.2.1. The game does not pass the apple review if you build the game in Corona 2019.3559. It is necessary to solve this problem, in the stable version everything is fine. Thanks!



[TOPIC: post.html]
#42

mlhdyx

[GLOBAL: userInfoPane.html]
mlhdyx
  • Enthusiast

  • 61 posts
  • Corona SDK

Same issue:

 

Build with corona 3562 and iOS SDK 13.3, 

 

Success to buy items but failed to verify the IAP when Run on a iOS 13.3 device.

 

My old version built with Corona 3468 and iOS SDK 12.1 works fine. But I can't go back...

 

What should I do now? :(



[TOPIC: post.html]
#43

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,615 posts
  • Enterprise

iOS 13 changed the IAP receipt format. We have a plugin in the Marketplace called Apple IAP or something similar that does proper receipt validation. 

 

Rob



[TOPIC: post.html]
#44

mlhdyx

[GLOBAL: userInfoPane.html]
mlhdyx
  • Enthusiast

  • 61 posts
  • Corona SDK

So use require( "plugin.apple.iap" ) instead of require("store") would fix the issue?

 

 

iOS 13 changed the IAP receipt format. We have a plugin in the Marketplace called Apple IAP or something similar that does proper receipt validation. 

 

Rob



[TOPIC: post.html]
#45

colinmorgan

[GLOBAL: userInfoPane.html]
colinmorgan
  • Enthusiast

  • 45 posts
  • Corona SDK

Although it is not mentioned in the documentation, vlads mentions about a quarter of the way down this thread that you need to include the following in your build.settings file:

settings =
{
    plugins =
    {
        ["plugin.apple.iap"] = { publisherId = "com.coronalabs" },
        ["plugin.apple.iap.helper"] = { publisherId = "com.coronalabs" },
    }
}

Then, in your main code, the store call looks like this:

local store = require "plugin.apple.iap"

Also, if you're using IAP Badger, you can download the library from github, modify line 1666 to require "plugin.apple.iap" instead of "store", include it with the rest of your project files and then call your modified version of IAP Badger instead of the IAP Badger plugin.

 



[TOPIC: post.html]
#46

GamingStudio17

[GLOBAL: userInfoPane.html]
GamingStudio17
  • Contributor

  • 185 posts
  • Corona SDK

iOS 13 changed the IAP receipt format. We have a plugin in the Marketplace called Apple IAP or something similar that does proper receipt validation. 

 

Rob

In the Corona assembly 2019.3476 everything works and passes the review of the Apple. Why can't you do the same in the new version? Why do I need some kind of plugins, etc.



[TOPIC: post.html]
#47

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,615 posts
  • Enterprise

The reason 3476 works is that it's based on iOS 12. In iOS 12, the receipt format still worked with the older store.* When Apple moved to iOS 13, they changed the receipt format and the old store.* no longer works with it. store.* works with everything else. We produced a plugin that works with iOS 13. store.* should be a plugin and for Android and Amazon, IAP is a plugin.

 

The Apple IAP plugin was designed to be a plugin so we can updated it and manage it without having to update the core. Now all of the various provider's store IAP's are on the same method (plugins).

 

Rob



[TOPIC: post.html]
#48

mlhdyx

[GLOBAL: userInfoPane.html]
mlhdyx
  • Enthusiast

  • 61 posts
  • Corona SDK

use the IAP plugin, but crash happened:

 

"attempt to index filed transaction (a nil value)"



[TOPIC: post.html]
#49

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,615 posts
  • Enterprise

@mlhdyx, we need more information than that to help.

 

Are you putting in any print statements? 

Do you know where that error is coming from (which API call)?

Can you share the code for your IAP listener function? Where you're making your various API calls?

 

Rob



[TOPIC: post.html]
#50

mlhdyx

[GLOBAL: userInfoPane.html]
mlhdyx
  • Enthusiast

  • 61 posts
  • Corona SDK

"
function transactionCallback( event )
    if ( event.name == "init" ) then
        if not ( event.transaction.isError ) then   -- crash happened here
 
"
 
"function MobileStore:InitStore()
     if ( system.getInfo( "platformName" ) == "iPhone OS" ) then
        self.store = require( "plugin.apple.iap" )
        currentProductList = appleProductList
 
        LOG("init for apple store")
        self.store.init(transactionCallback)   -- here set the callback
"



[topic_controls]
Page 2 of 4 1 2 3 4
 
[/topic_controls]