IAP fails to init on iOS build - missing entitlements

Hello all,

Wondering if anyone has seen or has ideas on the following issue. My game has started failing IAP initialization when building for iOS.

It looks like IAP needs com.apple.developer.web-browser-engine.rendering AND target is not running or doesn’t have entitlement com.apple.developer.web-browser-engine.networking AND target is not running or doesn’t have entitlement com.apple.developer.web-browser-engine.webcontent
and these aren’t being added?

I’ve taken a look at apple’s documentation on capabilities Entitlements | Apple Developer Documentation

and looked through what can be added post build in xcode following these steps
https://help.apple.com/xcode/mac/current/#/dev88ff319e7
but none of the capabilities listed seem to be relevant, In-App Purchases is already added

Unity version is 2022.3.55f1 and IAP package version is 4.12.2

  • I am not adding any product ID’s on iOS at this time, just trying to initialize IAP.
  • IAP works both in editor and on android, with product ID’s
  • xcode is managing signing
  • the app seems to build clean with no errors

IAP is initialized in this constructor - the constructor is failing

    public InAppPurchasingManager () {

        #if UNITY_EDITOR
        StandardPurchasingModule.Instance().useFakeStoreUIMode = FakeStoreUIMode.StandardUser;
        #endif

        var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
        #if UNITY_IOS
        Debug.Log("Not initializing products - ios IAP not approved yet");
        #else
        builder.AddProduct("gempack_100", ProductType.Consumable, new IDs
        {
            {"gempack_100_google", GooglePlay.Name},
            {"gempack_100_apple", AppleAppStore.Name}
        });
        builder.AddProduct("gempack_250", ProductType.Consumable, new IDs
        {
            {"gempack_250_google", GooglePlay.Name},
            {"gempack_250_apple", AppleAppStore.Name}
        });
        builder.AddProduct("gempack_500", ProductType.Consumable, new IDs
        {
            {"gempack_500_google", GooglePlay.Name},
            {"gempack_500_apple", AppleAppStore.Name}
        });
        builder.AddProduct("gempack_1000", ProductType.Consumable, new IDs
        {
            {"gempack_1000_google", GooglePlay.Name},
            {"gempack_1000_apple", AppleAppStore.Name}
        });
        builder.AddProduct("gempack_2500", ProductType.Consumable, new IDs
        {
            {"gempack_2500_google", GooglePlay.Name},
            {"gempack_2500_apple", AppleAppStore.Name}
        });
        builder.AddProduct("season_pass", ProductType.Subscription, new IDs
        {
            {"season_pass_sub_google", GooglePlay.Name},
            {"season_pass_apple", AppleAppStore.Name}
        });
        #endif

        UnityPurchasing.Initialize (this, builder);
    }

The error in the xcode log is the following:


UnityIAP: Requesting product data...

Failed to terminate process: Error Domain=com.apple.extensionKit.errorDomain Code=18 "(null)" UserInfo={NSUnderlyingError=0x30290f9c0 {Error Domain=RBSRequestErrorDomain Code=3 "No such process found" UserInfo={NSLocalizedFailureReason=No such process found}}}

Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "((target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.rendering AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.networking AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.webcontent))" UserInfo={NSLocalizedFailureReason=((target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.rendering AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.networking AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.webcontent))}>

Failed to terminate process: Error Domain=com.apple.extensionKit.errorDomain Code=18 "(null)" UserInfo={NSUnderlyingError=0x302926370 {Error Domain=RBSRequestErrorDomain Code=3 "No such process found" UserInfo={NSLocalizedFailureReason=No such process found}}}

0x128024840 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'XPCConnectionTerminationWatchdog' for process with PID=517, error: (null)

Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}>

0x1280243c0 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'WebProcess NearSuspended Assertion' for process with PID=517, error: (null)

@AndrewAtCandlelight Same issue any solutions?

I am thinking that for me it might be that IAP does not fully initialize because there are no products returned from Apple. The apple extensionkit error is looking for a process which is null.

I am seeing an IAP OnInitializeFailed because the app store didn’t return any products.

At first I thought I could get around this by passing no products for IAP to look for, but this seems to cause the same initialization failure (see the atrocious conditional compilation conditions in the code above)

If this is the case I’m not sure how to test because Apple won’t return the product until IAP’s have been reviewed, which requires submitting a binary with them for review - and it seems premature to submit for review until I understand that extensionKit error.

Seems like a chicken/egg problem that likely has a solution I am just not aware of - and all of that is just on the hunch that IAP not initializing is actually what is causing the extensionKit error.

![


.png)

I am getting these logs on Xcode
and OnInitialized Method never get’s called

This is similar to what I am seeing.

Has Apple reviewed/approved your first IAP in App Store Connect yet?

@AndrewAtCandlelight
For Unity IAP to work in 4.12.2, you need to initialize with at least 1 successful product, otherwise the initialization will fail.

Your app doesn’t need to be reviewed to be able to test it. You should be able to add your products and test in Sandbox and TestFlight.

Your error doesn’t seem related to IAP (first time we see this one). I tried to replicate it by setting 0 products on IAP 4.12.2, but I wasn’t able to get it. If this still happens after setting some products, could you provide more information so we can look into this more?

@kaushikjadavexpertappdev
In your case, you have 0 valid product and 1 invalid product which is why the initialization is failing.
This thread had a few solutions that should help you solve the issue: Initialization Failed: NoProductsAvailable

Thanks Yannick, will let you know

@Yannick_D

As far as the original error described above - IAP is the only thing in the app not working as expected, as far as I can tell. The other suspect I would raise would be admob, which I am using, but it’s serving test ads (actual streamed Google Test Ads, not the prefab) without issue.
Built to testflight and distributed to a device through that channel - IAP does not initialize, which is not surprising as the IAP is not reviewed. Review of your first IAP only seems to happen during an actual app review for release.

See the screenshot provided in Unity docs, #4 after “Add In App Purchase”

its’ very similar (a little outdated, I don’t think ITunes Connect is a thing anymore - redirects to appstore connect) to what I see on App Store Connect:

It does not seem that you can actually add IAP to a product in test without submitting a version for a full review - what am I missing there? I submitted a build for public test release but I don’t see how to add IAP to that for review. Maybe I am just being overly cautious and should just submit for App Review, that just seems out of order.

You’re right, it does seem like you have to submit a version for a full review to be able to add IAP:

However, that version doesn’t need to be released afterwards.

Another option would be to use a storekit configuration file in XCode to simulate the Apple App Store locally: