Error in Unity IAP on iOS is causing APP rejection.

AppStore review rejected the application 4 times because of the error in the IAP. When performing the test with a SandBox account the IAP works perfectly. However, if you logged in with a real user account the error occurs.


Comments:

  • Before submitting the app for review, we've made changes to the IAPs and all are in the status of "Waiting for review"
  • In-App Purchase is active in Xcode Capabilities
  • The code works if you are logged in with a sandbox account.
  • The same code generates the error if it is logged in with a real user account.



Error Log:


Purchase failure description message: APPLE_Can't connect to the iTunes Store

UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])

UnityEngine.Logger:Log(LogType, Object)

UnityEngine.Debug:Log(Object)

Loja:OnPurchaseFailed(Product, PurchaseFailureReason)

UnityEngine.Purchasing.StoreListenerProxy:OnPurchaseFailed(Product, PurchaseFailureReason)

UnityEngine.Purchasing.PurchasingManager:OnPurchaseFailed(PurchaseFailureDescription)

UnityEngine.Purchasing.JSONStore:OnPurchaseFailed(PurchaseFailureDescription, String)

UnityEngine.Purchasing.<>c__DisplayClass35_0:<MessageCallback>b__0()

UnityEngine.Purchasing.Extension.UnityUtil:Update()



Unity Versions: 2018.2.9f1, 2018.2.8f1 and 2018.2.7f1


Unity IAP versions tested: 1.20 and 1.21


Xcode versions: 9.4 and 10.



What can I do to solve the problem?

This problem is in storekit the error returned is SKErrorUnknown. The code works if you are logged in with a sandbox account.

Clearly you need to contact the "UnityEngine" people.


The app itself is signed with either a production certificate or a sandbox certificate. That determines which environment it will operate in and which type of user should log in. When run from Xcode it goes to the sandbox. When run from TestFlight it goes to the sandbox and it creates a duplicate test user in the sandbox environment with the same username and password as the current production user. When run from App Review it still goes to the sandbox. So it is unclear what errors you are referring to when you say "causing app rejection" and "when you log in with a real user account".


Aside - when testing in a submitted app, if you are using receipt verification, you test for a production receipt first and, if that fails, you test for a sandbox receipt. That way it works in App Review and when launched from the app store.

Error in Unity IAP on iOS is causing APP rejection.
 
 
Q