# iOS deprecated APIs

> Identify deprecated Unity Ads SDK classes for iOS, as well as the replacement and removal versions.

## iOS deprecated classes

The following API classes are deprecated or obsolete for the iOS SDK for the Unity Ads SDK version 4.19.0.

### Initialization

| **API to be removed**                                                                                                   | **Deprecated in version** | **What to use instead**                                                                                                         | **Removed in version** | **Deprecation reason**                                                                                                                                          |
| ----------------------------------------------------------------------------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `UADSMediationMetaData`                                                                                                 | 4.19.0                    | `UADSMediationInfo` — initialized with `initWithName:version:adapterVersion:`                                                   | 5.0.0                  | Replaced by the typed `UADSMediationInfo` value object used in the builder-based initialization API.                                                            |
| `[UnityAds setDebugMode:]`                                                                                              | 4.19.0                    | Set `UADSLogLevel` via `[UADSInitializationConfigurationBuilder withLogLevel:]` (e.g. `UADSLogLevelDebug`)                      | 5.0.0                  | The boolean debug-mode toggle is replaced by a 4-level `UADSLogLevel` set on the initialization configuration builder, giving finer control over log verbosity. |
| `[UnityAds initialize:]` and all overloads (`initializationDelegate:`, `testMode:`, `testMode:initializationDelegate:`) | 4.19.0                    | `[UnityAds initialize:[builder build] completion:^(id<UnityAdsError> error){…}]` using `UADSInitializationConfigurationBuilder` | 5.0.0                  | Replaced by the builder-pattern initialization API with a completion block instead of a delegate.                                                               |
| `UnityAdsInitializationDelegate` protocol                                                                               | 4.19.0                    | Pass a completion block `^(id<UnityAdsError> error)` to the new `[UnityAds initialize:completion:]` method                      | 5.0.0                  | Delegate-based initialization callback replaced by completion blocks for simpler, inline error handling.                                                        |

### Interstitial ads

| **API to be removed**                                              | **Deprecated in version** | **What to use instead**                                                                                             | **Removed in version** | **Deprecation reason**                                                                                                             |
| ------------------------------------------------------------------ | ------------------------- | ------------------------------------------------------------------------------------------------------------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `[UnityAds load:options:loadDelegate:]` (interstitial)             | 4.19.0                    | `[UADSInterstitialAd load:[builder build] completion:^(UADSInterstitialAd *ad, id<UnityAdsError> error){…}]`        | 5.0.0                  | Class method on UnityAds replaced by an instance method on the loaded ad object, with the result delivered via a completion block. |
| `UnityAdsLoadDelegate` protocol (interstitial)                     | 4.19.0                    | Pass a completion block to `[UADSInterstitialAd load:completion:]`                                                  | 5.0.0                  | Delegate callbacks replaced by completion blocks in the instance-based ad loading API.                                             |
| `UADSLoadOptions.adMarkup` (interstitial)                          | 4.19.0                    | `[UADSLoadConfigurationBuilder withAdMarkup:]`                                                                      | 5.0.0                  | Mutable property replaced by an immutable builder-pattern configuration.                                                           |
| `UADSLoadOptions.objectId` (interstitial)                          | 4.19.0                    | No replacement — object ID is now managed internally by the SDK                                                     | 5.0.0                  | Manual correlation IDs are no longer required; the SDK handles ad instance tracking internally.                                    |
| `[UnityAds show:placementId:options:showDelegate:]` (interstitial) | 4.19.0                    | `[self.interstitialAd show:[builder build] delegate:delegate]` on the `UADSInterstitialAd` instance                 | 5.0.0                  | Class method on UnityAds replaced by an instance method on the loaded ad object.                                                   |
| `UnityAdsShowDelegate` protocol (interstitial)                     | 4.19.0                    | `UADSInterstitialShowDelegate` with `showDidStart:`, `showDidClick:`, `showDidComplete:with:`, `showDidFail:error:` | 5.0.0                  | Generic show delegate replaced by an ad-type-specific delegate that passes the ad instance rather than a placement ID string.      |
| `UADSShowOptions.objectId` (interstitial)                          | 4.19.0                    | No replacement — object ID is now managed internally by the SDK                                                     | 5.0.0                  | Manual correlation IDs are no longer required; the SDK handles ad instance tracking internally.                                    |
| `UADSShowOptions` (interstitial)                                   | 4.19.0                    | `UADSShowConfigurationBuilder` — use `withViewController:`                                                          | 5.0.0                  | Mutable options object replaced by an immutable builder-pattern show configuration.                                                |

### Rewarded ads

| **API to be removed**                                                    | **Deprecated in version** | **What to use instead**                                                                                                                | **Removed in version** | **Deprecation reason**                                                                                                                                                        |
| ------------------------------------------------------------------------ | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `[UnityAds load:options:loadDelegate:]` (rewarded)                       | 4.19.0                    | `[UADSRewardedAd load:[builder build] completion:^(UADSRewardedAd *ad, id<UnityAdsError> error){…}]`                                   | 5.0.0                  | Class method on UnityAds replaced by an instance method on the loaded ad object, with the result delivered via a completion block.                                            |
| `UnityAdsLoadDelegate` protocol (rewarded)                               | 4.19.0                    | Pass a completion block to `[UADSRewardedAd load:completion:]`                                                                         | 5.0.0                  | Delegate callbacks replaced by completion blocks in the instance-based ad loading API.                                                                                        |
| `UADSLoadOptions.adMarkup` (rewarded)                                    | 4.19.0                    | `[UADSLoadConfigurationBuilder withAdMarkup:]`                                                                                         | 5.0.0                  | Mutable property replaced by an immutable builder-pattern configuration.                                                                                                      |
| `UADSLoadOptions.objectId` (rewarded)                                    | 4.19.0                    | No replacement — object ID is now managed internally by the SDK                                                                        | 5.0.0                  | Manual correlation IDs are no longer required; the SDK handles ad instance tracking internally.                                                                               |
| `[UnityAds show:placementId:options:showDelegate:]` (rewarded)           | 4.19.0                    | `[self.rewardedAd show:[builder build] delegate:delegate]` on the `UADSRewardedAd` instance                                            | 5.0.0                  | Class method on UnityAds replaced by an instance method on the loaded ad object.                                                                                              |
| `UnityAdsShowDelegate` protocol (rewarded)                               | 4.19.0                    | `UADSRewardedShowDelegate` with a dedicated `showDidReceiveReward:` callback                                                           | 5.0.0                  | Generic show delegate replaced by a rewarded-specific delegate with a dedicated reward callback.                                                                              |
| `UADSShowOptions.objectId` (rewarded)                                    | 4.19.0                    | No replacement — object ID is now managed internally by the SDK                                                                        | 5.0.0                  | Manual correlation IDs are no longer required; the SDK handles ad instance tracking internally.                                                                               |
| `UADSPlayerMetaData` (`-setServerId:`)                                   | 4.19.0                    | `[UADSShowConfigurationBuilder withCustomRewardString:]` on the `UADSShowConfiguration` passed into `-[UADSRewardedAd show:delegate:]` | 5.0.0                  | The metadata-based server-side reward verification ID is replaced by a typed `customRewardString` on the show configuration, consistent with the builder-based ad object API. |
| `kUnityShowCompletionStateCompleted`, `kUnityShowCompletionStateSkipped` | 4.19.0                    | `UADSShowFinishStateCompleted`, `UADSShowFinishStateSkipped`                                                                           | 5.0.0                  | Constants renamed as part of the unified `UADSShowFinishState` type.                                                                                                          |
| `UnityAdsShowCompletionState`                                            | 4.19.0                    | `UADSShowFinishState`                                                                                                                  | 5.0.0                  | Enum type renamed for consistency with the new instance-based ad API.                                                                                                         |

### Banner ads

| **API to be removed**                                                              | **Deprecated in version** | **What to use instead**                                                                                                                   | **Removed in version** | **Deprecation reason**                                                                                                                                                                           |
| ---------------------------------------------------------------------------------- | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `UADSBannerView`                                                                   | 4.19.0                    | `UADSBannerAd` — access the view via the `.view` property and add it to your hierarchy                                                    | 5.0.0                  | Direct view class replaced by an ad instance object whose view is accessed via a property, consistent with the new ad object model.                                                              |
| `UADSBannerViewDelegate` protocol                                                  | 4.19.0                    | `UADSBannerAdDelegate` with `bannerImpression:`, `bannerDidClick:`, `bannerDidFailShow:error:`                                            | 5.0.0                  | View-level delegate replaced by an ad-object delegate. The load result moves into the `load(_:completion:)` completion handler; `bannerViewDidLeaveApplication:` is removed with no replacement. |
| `bannerViewDidLoad:` on `UADSBannerViewDelegate`                                   | 4.19.0                    | Load result is now delivered via the `UADSBannerAd.load(_:completion:)` completion block — no delegate callback                           | 5.0.0                  | Load notification moved out of the delegate and into the load completion block, matching the new interstitial and rewarded loading pattern.                                                      |
| `bannerViewDidLeaveApplication:` on `UADSBannerViewDelegate`                       | 4.19.0                    | No replacement                                                                                                                            | 5.0.0                  | Callback removed with no equivalent in the new `UADSBannerAdDelegate`.                                                                                                                           |
| `[[UADSBannerView alloc] initWithPlacementId:size:]` + `[banner loadWithOptions:]` | 4.19.0                    | `[UADSBannerAd load:[builder build] completion:^(UADSBannerAd *ad, id<UnityAdsError> error){…}]` via `UADSBannerLoadConfigurationBuilder` | 5.0.0                  | Constructor + separate load method replaced by a unified static load with a builder configuration and a completion block, matching the new interstitial and rewarded loading pattern.            |
| `UADSBannerLoadOptions`                                                            | 4.19.0                    | `UADSBannerLoadConfiguration` built via `UADSBannerLoadConfigurationBuilder`                                                              | 5.0.0                  | Banner-specific mutable load options object replaced by an immutable builder-pattern configuration.                                                                                              |
| `UADSLoadOptions.adMarkup` (banner)                                                | 4.19.0                    | `[UADSBannerLoadConfigurationBuilder withAdMarkup:]`                                                                                      | 5.0.0                  | Mutable property replaced by an immutable builder-pattern configuration.                                                                                                                         |
| `UADSLoadOptions.objectId` (banner)                                                | 4.19.0                    | No replacement — object ID is now managed internally by the SDK                                                                           | 5.0.0                  | Manual correlation IDs are no longer required; the SDK handles ad instance tracking internally.                                                                                                  |

### Token collection (bidding)

| **API to be removed**                                                                   | **Deprecated in version** | **What to use instead**                                                                                       | **Removed in version** | **Deprecation reason**                                                                                                                                                                                                              |
| --------------------------------------------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------- | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `+[UnityAds getToken]`, `+[UnityAds getToken:]`, `+[UnityAds getTokenWith:completion:]` | 4.19.0                    | `+[UnityAds getToken:completion:]` with a `UADSTokenConfigurationBuilder`-built configuration                 | 5.0.0                  | The no-arg getter, the completion-only getter, and the legacy `UnityAdsTokenConfiguration` overload are all replaced by a single entry point that takes a typed `UADSTokenConfiguration` built via `UADSTokenConfigurationBuilder`. |
| `UnityAdsTokenConfiguration` + `[UnityAdsTokenConfiguration newWithAdFormat:]`          | 4.19.0                    | `UADSTokenConfigurationBuilder` — use `initWithAdFormat:`, `withMediationInfo:`, optionally `withBannerSize:` | 5.0.0                  | Configuration object replaced by a builder, enabling mediation info and banner size to be included in a consistent pattern.                                                                                                         |
| `UnityAdsAdFormat` enum                                                                 | 4.19.0                    | `UADSAdFormat` enum with values `UADSAdFormatBanner`, `UADSAdFormatInterstitial`, `UADSAdFormatRewarded`      | 5.0.0                  | Enum renamed for namespace consistency with the new `UADS`-prefixed API surface.                                                                                                                                                    |

### Privacy

| **API to be removed**                                                     | **Deprecated in version** | **What to use instead**                                                            | **Removed in version** | **Deprecation reason**                                                                               |
| ------------------------------------------------------------------------- | ------------------------- | ---------------------------------------------------------------------------------- | ---------------------- | ---------------------------------------------------------------------------------------------------- |
| `UADSMetaData` with key `gdpr.consent`                                    | 4.19.0                    | `[UnityAds setUserConsent:]`                                                       | 5.0.0                  | String key-value privacy metadata replaced by a typed static method.                                 |
| `UADSMetaData` with key `privacy.consent` (CCPA)                          | 4.19.0                    | `[UnityAds setUserOptOut:]` — pass `YES` when the user has opted out (Do Not Sell) | 5.0.0                  | String key-value privacy metadata replaced by a typed static method with explicit opt-out semantics. |
| `UADSMetaData` with key `user.nonBehavioral` (COPPA, child-directed laws) | 4.19.0                    | `[UnityAds setNonBehavioral:]`                                                     | 5.0.0                  | Privacy mode string replaced by an explicit boolean API for non-behavioral/contextual ad control.    |

### Error handling

| **API to be removed**              | **Deprecated in version** | **What to use instead**                                                                 | **Removed in version** | **Deprecation reason**                                                                                   |
| ---------------------------------- | ------------------------- | --------------------------------------------------------------------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------- |
| `UnityAdsInitializationError` enum | 4.19.0                    | Unified `id<UnityAdsError>` protocol with `.code` (NSInteger) and `.message` (NSString) | 5.0.0                  | Separate per-operation error enums replaced by a unified error protocol with standardized numeric codes. |
| `UnityAdsLoadError` enum           | 4.19.0                    | Unified `id<UnityAdsError>` protocol                                                    | 5.0.0                  | Separate per-operation error enums replaced by a unified error protocol with standardized numeric codes. |
| `UnityAdsShowError` enum           | 4.19.0                    | Unified `id<UnityAdsError>` protocol                                                    | 5.0.0                  | Separate per-operation error enums replaced by a unified error protocol with standardized numeric codes. |
| `UADSBannerErrorCode` enum         | 4.19.0                    | Unified `id<UnityAdsError>` protocol                                                    | 5.0.0                  | Banner-specific error enum replaced by the same unified error protocol used across all ad types.         |
