RevenueCat / purchases-ios

In-app purchases and subscriptions made easy. Support for iOS, watchOS, tvOS, macOS, and visionOS.
https://www.revenuecat.com/
MIT License
2.2k stars 294 forks source link

Remove AdClient framework related code #3993

Closed vegaro closed 1 week ago

vegaro commented 1 week ago

We had a report of a developer that is seeing that users (who are using iOS 18 beta) are reporting app crashes on launch with 55 unique devices so far. They are using using iOS SDK 4.17.7.

The line that is crashing is:

client = clientClass.perform(#selector(FakeAfficheClient.sharedClient)).takeUnretainedValue()

We just couldn’t have a single variable named adClient without an app getting rejected, even if it wasn’t using it at all. We built the AfficheClient so prevent app rejections.

It turns out Apple has removed documentation for AdClient, and by looking into https://developer.apple.com/documentation/iad/setting-up-apple-search-ads-attribution#overview

After February 7, 2023, all requests made to the Apple Search Ads iAd Attribution API will return with a value of "iad-attribution" = false, or errors. See ADClient/requestAttributionDetails(_:). Use the AdServices framework for current attribution integration with the Apple Search Ads Campaign Management API for devices using iOS 14.3 and later. Attribution isn't available for downloads and redownloads from devices using iOS 14.2 or earlier.

So this wasn't even working anyways. I removed everything related but left the public API in place to not break anyone.