Unity IAP Services not Working in my release App since iOS 13.4. The purchase dialog does not show.

Hello, I have an App developed with Unity 2018.4.5f and Unity IAP 1.23.1 containing a non-consumable products. The app is in release version and available on the appStore for almost 1 year. The IAP has always been functional except since IOS 13.4 update. On IOS 13.4 + devices, the native purchase popup no longer opens. Another clarification, the price of the non-consumable product was reduced to $ 0 the time of the covid. Can the purchase price influence the functioning of the Unity IAP purchase?

The implementation method of the IStoreListener is inspired by your tutorial (Unity IAP - Unity Learn).

In the Unity Dashboard I can see crash log for IOS 13.4 devices.

Native Crash - Unknown Function (/usr/lib/system/libsystem_kernel.dylib)

Native StackTrace:
Thread 39
0 libsystem_kernel.dylib 0x00000001ad255198
1 libEmbeddedSystemAUs.dylib 0x00000001cbb28330
2 libAudioToolboxUtility.dylib 0x00000001b87ec614
3 libsystem_pthread.dylib 0x00000001ad197d98
4 libsystem_pthread.dylib 0x00000001ad19b74c

Part of logs:

{"message":"IAPController IsInitialized: 'True'","ts":1591908958560,"frame":803,"type":3},{"message":"Purchasing product asychronously: 'Premium'","ts":1591908958561,"frame":803,"type":3},{"message":"m_StoreController.InitiatePurchase: 'Premium'","ts":1591908958562,"frame":803,"type":3},{"message":"purchase({0}): Premium","ts":1591908958570,"frame":803,"type":3}],"ts":1591969612570,"user_agent":"NameOfApp/3865.576%0A CFNetwork/1126 Darwin/19.5.0","project_name":"NameOfApp","crash_report_hash":"6b1ff059bf15ed3b3bd545faa0a7a1fa","managed_exception":null,"native_crash":{"signal_name":"SIGABRT","signal_code":"#0","signal_address":7200009608,"signal_pc":0,"symbolicated":true,"threads":[{"number":0,"name":"","crashed":true,"frames":[{"image_uuid":"b422ba38a9f63062be28d28d39e3fe25","image_name":"/usr/lib/system/libsystem_kernel.dylib"

Have you ever had this problem and how to fix it?

Thanks!

@mares_unity Are you able to reproduce? Your IAP works on iOS devices less than 13.4? We have not heard of any specific reports. Were you able to change the price, after you already sold some of the product? How would users request refunds in that case? I’m not familiar if the pricing could be related. As a test, can you put back the price?

Thank you @JeffDUnity3D for being quick. Yes, I can reproduce the problem on IOS 13.4 and higher each time. The purchase button does not open the purchase window. The price has been reduced recently, several purchases were made before the price drop. It’s not me who deals with prices on the App Store, I do not know the process for request refunds. I will ask that we change the price to test again. I come back to you with the result.

Does it work on devices less than 13.4? If it does, it’s probably not related to the price.

The IAP purchase still works very well on ios 13.3 and less devices.
I contacted Apple technical support to find out more about the impact of a price change.

Since you can reproduce, you should be able to get the device logs via XCode as described here How To - Capturing Device Logs on iOS They would be invaluable to troubleshoot this issue. We write system debug info to the logs from IAP

Hi @JeffDUnity3D , I have some logs from xCode, I hope it will help you to help me!

After several attempts, the problem is still not resolved, when trying to make a purchase, the native purchase box is not displayed. The app is not able to connect to the store! On the other hand, when we use the restoration of purchases function, the native popup to connect to the App Store is displayed, once the account information has been entered, the restoration works correctly.

Here the xCode Crash report

{
  "LocallySymbolicatedSourceFile" : "",
  "UserData" : {
    "Resolved" : false,
    [COLOR=#ff0000]"Name" : "StoreKit: -[SKPaymentQueue finishTransaction:] + 608",[/COLOR]
    "Description" : ""
  },
  "LocallySymbolicatedDefaultName" : "",
  "DefaultName" : "StoreKit: -[SKPaymentQueue finishTransaction:] + 608",
  "LocallySymbolicatedSourceLine" : 0,
  "Identifier" : {
    "AdamId" : "*********",
    "BundleId" : "com.***********",
    "Version" : "1.08",
    "IsBeta" : true,
    "Build" : "3862.573",
    "PlatformSDKIdentifier" : "com.apple.platform.iphoneos",
    "RootBuild" : "3862.573",
    "RootVersion" : "1.08",
    "CrashPointId" : "BeDWOATqpBi2vdcZf68OSZ"
  },
"SourceLine" : 288,
"SourceFile" : "SKPaymentQueue.m"
}

xCode console log report when clicking on the purchase button

Task <E8791D5F-08D2-48DC-9C51-25586636B3D7>.<1> now using Connection 17

Connection 17: received viability advisory(Y)

Task <E8791D5F-08D2-48DC-9C51-25586636B3D7>.<1> sent request, body S 556

boringssl_context_message_handler(2258) [C17.1:2][0x108a66de0] Reading SSL3_RT_HANDSHAKE 149 bytes

boringssl_context_new_session_handler(1117) [C17.1:2][0x108a66de0] New session available

UnityIAP: UpdatedTransactions

UnityIAP: PurchaseFailed: 0

com.apple.appstored StoreKit default 11:02:56.796436-0400 appstored appstored com.****..****.: Loading 1 products for com..****...****.

UnityIAP: UnityPurchasing OnPurchaseFailed: Unknown - SKErrorUnknown - APPLE_Connexion à l’iTunes Store impossible

And in attached file a crash log on a newer version of the app. Do you have enough information? Thank you so much.

5997653–645557–xCodeCrashInfos.crash.txt (21.6 KB)

It says you can’t connect to iTunes. Can you open the Apple App Store on this device? And I’m not seeing any logs where you initialize IAP, should show the version number

Yes, I can open the Apple App Store on this device.
I don’t seem to have the start of the logs. But I have confirmation that Unity IAP initializes correctly on a screenshot.

Is it possible that my Unity IAP updated to version 1.23.1 but not the UnityPurchasing.m file? I read this post How to support PurchaseFailureReason.Unknown?
and I have only 3 error code in this method :

- (NSString*)purchaseErrorCodeToReason:(NSInteger) errorCode {
    switch (errorCode) {
        case SKErrorPaymentCancelled:
            return @"UserCancelled";
        case SKErrorPaymentInvalid:
            return @"PaymentDeclined";
        case SKErrorPaymentNotAllowed:
            return @"PurchasingUnavailable";
    }

    return @"Unknown";
}

Have new error cases been added in the latest updated version?

You have the right version. Are you able to test with a previous version of IAP? I just tested an older test app on my iPhone, I believe it is using IAP 1.19, and it works OK with iOS 13.4.1 . Hopefully I can test with 1.23.1 next week.

Ok, thanks for your test. I will revert to IAP 1.19 and check if it works. I come back to you with the result.

1 Like

Before changing the version of Unity IAP, I saw this log between Purchase and OnPurchaseFailed.

Internal : JobTempAlloc has allocations that are more than 4 frames old - this is not allowed and likely a leak
To Debug, enable the define: TLA_DEBUG_STACK_LEAK in ThreadsafeLinearAllocator.cpp. This will output the callstacks of the leaked allocations.

Do you know this problem?

Unfortunately, I have exactly the same problem with IAP version 1.19. The $ 0 IAP promotion on the Apple Store ends in a few days. We will see later if the problem still persists. Thank you for your support.

Hello, my app still has the same problem with the IAP Purchase. The IAP purshase has always been functional except since IOS 13.4 update. On IOS 13.4 + devices, the native purchase popup no longer opens.

The promotion of the app is finished on the appStore, the IAP is no longer free.

My App is developed with Unity 2018.4.5f and Unity IAP is up to date (version 1.23.3) and build with xCode 11.4.1.

No matter what method I use to make the purchase, I always get the same error.

UnityIAP: UnityPurchasing OnPurchaseFailed: Unknown - SKErrorUnknown

Purchase finished with error: Error Domain=SSErrorDomain Code=16 “Cannot connect to iTunes Store” UserInfo={NSLocalizedDescription=Cannot connect to iTunes Store}

Here are the methods tested:

  • The implementation method of the IStoreListener is inspired by your tutorial (Unity IAP - Unity Learn). - In-APP FAIL on IOS 13.4+ but not 13.3-

  • With Easy Mobile Pro plugin (version 2.3.2) (https://www.easymobile.sglibgames.com/) - In-APP FAIL on IOS 13.4+ but not 13.3-

  • With your Sample IAP Project (IAP_Project.zip) ( Sample IAP Project ) - In-APP FAIL on IOS 13.4+ but not 13.3-

  • And last with Codeless IAP - In-APP FAIL on IOS 13.4+ but not 13.3-

From all these tests, the error does not seem to come from the IAP implementation code!

Have other developers noticed this problem? Currently, users of IOS 13.4 and later cannot purchase the IAP. This is a major problem because it is an income that my client loses!

Your help is greatly appreciated!

Would you agree that this sounds like an Apple issue? We have not heard of similar reports, but is worth investigating.

Yes, that this really sounds like an Apple issue! But I don’t know what to do. Apple recommends that I look in their developer forum. But I find no solution. Thank you for your support!

Are you testing in TestFlight? It may be an issue in their test environment. Or is this a published app?

The purchase problem occurs as much on the production version (which has been in release for almost a year) and on the new testFlight versions (containing attempts to resolve the problem).

So I’ve been working to test this. Unfortunately the two test apps on my 13.5.1 phone are configured to use a Sandbox account and it simply won’t accept my password. But I do get the purchase dialog, but just doesn’t verify my password. Looks like a separate Apple issue. At any rate, can you install WinterRunner from the app store, and attempt to make a $.99 purchase? It’s not my app, but does test Unity IAP. It’s up to you if you want to complete the purchase for a full test. Touch the Store button after the app starts, then touch the Gold coins and then Purchase. But it does look like that IAP is working.