IAP breaking after changing anything in player settings for IOS

Hi @JeffDUnity3D

I got a crazy one here. I’m using Unity2020.3.26f1with 4.1.2 purchaser, and all is working fine with IAP for my IOS game. Callbacks within the editor point to “true” so no issues. If I build out, it also has no issues and playing the game has all the IAP working properly through sandbox.

Here’s where it gets interesting. If I change anything in the player settings from the bundle version number, accelerometer frequency, minimum iOS version, checking/unchecking anything, etc. after building out, that version no longer has working IAP’s. Even if I restore everything back to what it was, it’ll still remain broken.

When running the game on Xcode, debug says my 7 products are now unavailable, and when trying to make a purchase, it basically stop the purchase on “try” which makes no sense.

Any thoughts as to what’s going on?

Are you publishing a new release through TestFlight when you make changes?

No, this was while testing locally. So I’ve tried more troubleshooting, here are my finds:

Regardless of using my 2014 iMac running Big Sur, or my M1 MacBook Pro M1 Pro with latest MacOS, I got the same results. I also tried 2022 version of Unity and as soon as I changed the accelerometer or changed anything in the player settings, it broke it. Changing the version number, or selecting/unchecking pro-motion button, or basically any changes to the player settings did the same thing.

As of now, I think it’s a Unity editor issue because when I manually update the version number and minimum iOS version, or anything else in Xcode, I can build it out successfully, but if I make any of those changes in unity and then build it out, it’ll break my IAP. This has never been an issue before, so I’m not sure why its happening now.

I took a stable version, and built it out without changing anything, works perfectly fine, then I just changed one player setting, and built the same one out, and IAP stopped working with Xcode given me this:

Initializing
Adding Products
Adding Products
Adding Products
Adding Products
Adding Products
2022-10-04 21:58:39.397067-0700 XXXXX[8273:1877133] UnityIAP: Requesting 7 products
2022-10-04 21:58:39.407750-0700 XXXXX[8273:1877133] I/UnityAds: +[UnityServices initialize:delegate:testMode:usePerPlacementLoad:] (line:50) :: Initializing Unity Ads 3.4.0 (3400) with game id XXXXX in production mode
Initialize Start
Initializing
Adding Products
Adding Products
Adding Products
Adding Products
Adding Products
2022-10-04 21:58:39.408118-0700 XXXXX[8273:1877133] UnityIAP: Requesting 7 products
2022-10-04 21:58:39.417555-0700 XXXXX[8273:1877404] fopen failed for data file: errno = 2 (No such file or directory)
2022-10-04 21:58:39.417589-0700 XXXXX[8273:1877404] Errors found! Invalidating cache...
2022-10-04 21:58:39.419987-0700 XXXXX[8273:1877366] I/UnityAds: -[USRVInitializeStateConfig execute] (line:167) :: Unity Ads init: load configuration from https://config.unityads.unity3d.com/webview/3.4.0/release/config.json
2022-10-04 21:58:39.471077-0700 XXXXX[8273:1877133] UnityIAP: Requesting product data...
2022-10-04 21:58:39.480372-0700 XXXXX[8273:1877133] UnityIAP: Requesting product data...
2022-10-04 21:58:39.745036-0700 XXXXX[8273:1877470] UnityIAP: Received 0 products
2022-10-04 21:58:39.745529-0700 XXXXX[8273:1877366] I/UnityAds: -[USRVInitializeStateLoadWeb execute] (line:236) :: Unity Ads init: loading webapp from https://config.unityads.unity3d.com/webview/3.4.0/90f60886e2d6e5e7bb8800cb6f428efd8b7066e9/release/index.html
2022-10-04 21:58:39.746479-0700 XXXXX[8273:1877470] UnityIAP: No App Receipt found
2022-10-04 21:58:39.757291-0700 XXXXX[8273:1877470] UnityIAP: Received 0 products
2022-10-04 21:58:39.757362-0700 XXXXX[8273:1877470] UnityIAP: No App Receipt found
2022-10-04 21:58:39.764095-0700 XXXXX[8273:1877133] UnityIAP: No App Receipt found
Unavailable product FBP300-FBP300
Unavailable product BBP99-BBP99
Unavailable product SBP199-SBP199
Unavailable product GBP299-GBP299
Unavailable product PBP499-PBP499
Unavailable product Sgtfrank-Sgtfrank
Unavailable product SKPLVL-SKPLVL

Then, building out the same exact one without changing anything, gives me a working version with Xcode saying this:

Initializing
Adding Products
Adding Products
Adding Products
Adding Products
Adding Products
2022-10-05 07:50:21.244222-0700 XXXXX[8987:2027140] UnityIAP: Requesting 7 products
2022-10-05 07:50:21.263365-0700 XXXXX[8987:2027140] I/UnityAds: +[UnityServices initialize:delegate:testMode:usePerPlacementLoad:] (line:50) :: Initializing Unity Ads 3.4.0 (3400) with game id XXXXX in production mode
Initialize Start
Initializing
Adding Products
Adding Products
Adding Products
Adding Products
Adding Products
2022-10-05 07:50:21.263729-0700 XXXXX[8987:2027140] UnityIAP: Requesting 7 products
2022-10-05 07:50:21.270631-0700 XXXXX[8987:2027394] I/UnityAds: -[USRVInitializeStateConfig execute] (line:167) :: Unity Ads init: load configuration from https://config.unityads.unity3d.com/webview/3.4.0/release/config.json
2022-10-05 07:50:21.276201-0700 XXXXX[8987:2027449] fopen failed for data file: errno = 2 (No such file or directory)
2022-10-05 07:50:21.276242-0700 XXXXX[8987:2027449] Errors found! Invalidating cache...
2022-10-05 07:50:21.355564-0700 XXXXX[8987:2027140] UnityIAP: Requesting product data...
2022-10-05 07:50:21.366954-0700 XXXXX[8987:2027140] UnityIAP: Requesting product data...
2022-10-05 07:50:21.786961-0700 XXXXX[8987:2027394] I/UnityAds: -[USRVInitializeStateLoadWeb execute] (line:236) :: Unity Ads init: loading webapp from https://config.unityads.unity3d.com/webview/3.4.0/90f60886e2d6e5e7bb8800cb6f428efd8b7066e9/release/index.html
2022-10-05 07:50:22.505571-0700 XXXXX[8987:2027140] I/UnityAds: +[USRVApiSdk WebViewExposed_logInfo:callback:] (line:67) :: Requesting configuration from https://publisher-config.unityads.unity3d.com/games/43561/configuration?networkOperator=310260&freeMemory=112464&batteryStatus=3&batteryLevel=1&screenBrightness=0.5&volume=0.3499999940395355&deviceFreeSpace=39685024&totalSpace=124884244&totalMemory=4096720&trackingAuthStatus=1&idfi=7d281d31-27d6-43c2-a14b-12311c140a23&advertisingTrackingId=00000000-0000-0000-0000-000000000000&limitAdTracking=false&installationId=baee1dce457be4605a60090b1c1af31a&connectionType=wifi&screenHeight=428&screenWidth=926&bundleId=com.behdadsamiinteractive.XXXXX&encrypted=true&rooted=false&platform=ios&sdkVersion=3400&osVersion=16.0&deviceModel=iPhone13%2C4&language=en_US&test=false&analyticsUserId=baee1dce457be4605a60090b1c1af31a&analyticsSessionId=2506509187426162508&first=true&framework=%5Bobject%20Object%5D&adapter=%5Bobject%20Object%5D&userLevelFlagDetected=false
2022-10-05 07:50:22.602914-0700 XXXXX[8987:2027140] I/UnityAds: +[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WjJVWnZqTS8wSnVjWWJ3Q1RWSWtMMUwxL0RIMHhIa0VkaWVqUVBFN0xUdWJlSzJKZkhZMno3Vk9iTml3PT0iLCJ0Z3QiOjIxLCJ4cHIiOjc2fQ.rP_T_ToRUJx8RMU75ozHRkpCKsnm0AOdSzYkZSALCMQ (A/B group 12)
2022-10-05 07:50:22.631773-0700 XXXXX[8987:2027140] I/UnityAds: +[USRVApiSdk WebViewExposed_logInfo:callback:] (line:67) :: Requesting ad plan from https://auction.unityads.unity3d.com/v6/games/43561/requests?idfi=7d281d31-27d6-43c2-a14b-12311c140a23&advertisingTrackingId=00000000-0000-0000-0000-000000000000&limitAdTracking=false&deviceModel=iPhone13%2C4&platform=ios&sdkVersion=3400&stores=apple&osVersion=16.0&screenScale=3&screenWidth=926&screenHeight=428&connectionType=wifi&networkType=0
2022-10-05 07:50:24.421944-0700 XXXXX[8987:2027499] UnityIAP: Received 5 products
2022-10-05 07:50:24.428271-0700 XXXXX[8987:2027499] UnityIAP: No App Receipt found
2022-10-05 07:50:24.445656-0700 XXXXX[8987:2027140] UnityIAP: No App Receipt found
Unavailable product FBP300-FBP300
Unavailable product Sgtfrank-Sgtfrank
2022-10-05 07:50:24.445786-0700 XXXXX[8987:2027140] UnityIAP: Add transaction observer
2022-10-05 07:50:24.445841-0700 XXXXX[8987:2027140] UnityIAP UnityEarlyTransactionObserver: Request to initiate queued payments
2022-10-05 07:50:24.448517-0700 XXXXX[8987:2027396] UnityIAP: Received 5 products
2022-10-05 07:50:24.449118-0700 XXXXX[8987:2027396] UnityIAP: No App Receipt found
2022-10-05 07:50:24.477760-0700 XXXXX[8987:2027140] UnityIAP: No App Receipt found
2022-10-05 07:50:24.477802-0700 XXXXX[8987:2027140] UnityIAP: Add transaction observer
2022-10-05 07:50:24.477827-0700 XXXXX[8987:2027140] UnityIAP UnityEarlyTransactionObserver: Request to initiate queued payments
Unloading 5 Unused Serialized files (Serialized files now loaded: 0)

@Ohyouknow Sorry, I meant have you tested with TestFlight? If not, this could be the cause. Once you publish via TestFlight, then subsequently you can test with local changes. Something to check anyway, we have not heard of this behavior. Which physical iOS device are you testing on?

So I uploaded one of the “broken” builds on my iTunes connect and through TestFlight, everything works as normal. It still makes no sense why locally, it’ll break the build like that, and even shows in the code that it cant receive the IAP products?

Any ideas why it’s breaking locally?

Can you isolate the issue in a new project? Sorry, I know that would be a pain to test. For my test app in TestFlight, I can make local changes in Unity, Build (with Replace) to my XCode project, then open in XCode, build and launch directly on my USB connected iPhone without issue.

I’m almost embarrassed to post this and it even makes me wonder how I was able to create a video game in the first place by overlooking something so simple. The issue was, my bundle identifier in Unity was incorrect. Once I corrected that, I haven’t had a single issue with builds since. Makes perfect sense… how can it call the IAP if the bundle identifier isn’t correct, it’s not going to receive anything lol…ahh, anyway, sorry to waste your time and thank you for the help!

1 Like