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:

@Yannick_D

So I moved ahead with beta and got everything else tight, then submitted for review on the app store.

App was rejected for completeness:

Guideline 2.1 - Performance - App Completeness

Issue Description

In-app purchase products associated with the app version submitted for review, such as 100 Gems, could not be found in the submitted binary.

Next Steps

If you do not want to make these in-app purchase products available at this time, remove the unused in-app purchase products you’ve created from App Store Connect.

If you want to make these in-app purchase products available at this time:

  • Ensure the products are active and that you have implemented StoreKit in your app. If you have not, submit a new binary for review with these changes.

  • Resubmit the in-app purchase products if they are in the Developer Action Required State. You must edit the detail information or cancel the request to change the detail information before the in-app purchase products can be reviewed again.

If you’ve already implemented StoreKit and enabled these in-app purchase products, reply to this message and explain where these can be found in the app.

Any thoughts on what I should be looking for in the built XCode for debugging?

Some other notes that may be relevant:
I have had several ruby and cocoapods issues along the way; Unity’s defaults kept failing and ultimately I had to use homebrew to get ios to build

ruby -v
ruby 3.3.3 (2024-06-12 revision f1c7b6f435) [arm64-darwin24]
pod --version
1.16.2

I had to toggle “always embed swift standard libraries” to OFF for AppStore Connect to archive / validation
see this link for similar issue xcode - UnityFramework.framework contains disallowed file 'Frameworks'. Getting this error while getting Unity IOS build - Stack Overflow

^ I suspect this one is likely the culprit but that puts me at a bit of an impasse…

This might actually be an appstore connect issue rather than the app itself - trying to get more info from Apple on why it was rejected.

after doing that pod install stuff, instead of opening the usual xcode project, do you have separate workspace project that has the pods combined with it? I think you need to upload that instead

I have these notes from when I finally had my project working with xcode (although my problem was levelPlay related):

Make a build
(It will fail to actually install pods to the project because External Depencency Manager has bugs)

Open Terminal

ruby -v
hopefully we have a compatible ruby version (3.3.4 was good at the time of this note)

pod --version
hopefully we have a compatible version of cocoa pods (1.15.2 was good at the time of this note)

which pod
shows the location of the cocoapods install, which is a gem inside ruby, whatever that means

cd (drag and drop the project folder of the xcode build that Unity built, make sure theres no extra space after the text you paste)
for example
cd /Users/username/Desktop/Unity/builds/mygame/mygame1.2.7_test02
pod install

this should install cocoapods for the project (what Unity failed to do when it made the build)

Now instead of opening the usual xcode project, open the xcworkspace

That is a combination of the project and the pods

Unity-iPhone > Info
We need to add things to the plist

Thanks Hibby, I don’t think this is the problem in my case - pods builds into the xcode project as expected.

@Yannick_D I moved this to a new thread: Unity IAP App Store Connect rejection

because I think it’s likely now an app store connect review issue - but its’s definitely possible that the original issue is causing problems for the reviewers. They rejected the app for completeness because the IAP buttons say “unavailable” - which they should, because the store doesn’t return any products, because the IAP was not approved, because the app was rejected for completeness…

I can’t be the only one with this issue?

I seem to recall submitting IAP products and having them approved, completely separately from the game build. Confusing process, whatever it is…

Are you able to get it all working on the Google Play Store?

Yes, it works on Google Play and in the editor.

I actually tried submitting just the IAP after the binary was rejected (wasn’t able to do that originally but can now that it has been submitted once), but that was rejected for “completeness” too, because it wasn’t accompanied by the binary… which seems to have been rejected because the IAP wasn’t present… which it wouldn’t be because it’s not approved yet…

Man what the hell. Well, at least you know it’s just Apple. Good luck man

Hi, I have exactly the same problem, works on google play and editor but not with apple. I would suggest you to see if there are any attached screenshots. Because in my case they send a screenshot where in the shop, the price and amount of coins was set to 0 in their phones for IDK why reasons. Did you fixed it?

@strompyvipex in my case it was because there was something in my Apple Developer Account’s financial agreements section that was not complete.

Check that you have agreed to all of the T’s & C’s etc for the finance section of your Apple Dev account and that you have banking info linked to it.

Seems like something that you’d expect to find out about elsewhere (like an alert in App Store Connect) but that’s not the case.

2 Likes

Yes you’re right, yesterday I accepted all the agreements and added my bank account and now it’s working ! Thank you