Skip to content

Migration from version 0.9.XXX to 1.0.0

Version 1.0.0 of the Ringier Ad SDK introduces significant improvements to the integration process, package size, and logging system. This guide outlines the necessary changes to upgrade your existing project.

1. Swift Package Manager (SPM) URL Update

The GitHub repository URL for integrating the SDK via Swift Package Manager (SPM) has changed. This move makes the repository public and reflects a massive reduction in package size, which will result in faster checkouts and improved CI performance.

Previous URLNew URL (v1.0.0)
https://github.com/RingierAdvertising/tagmanager-sdk-ios-publichttps://github.com/RingierAdvertising/tagmanager-sdk-ios

Action Required

  • In your Xcode project settings, navigate to the Package Dependencies tab.
  • Remove the old package dependency.
  • Add a new package dependency using the new GitHub URL provided above.

Performance Impact

The repository size has been dramatically reduced from approximately 360MB down to 40-50KB. This change will be highly noticeable in faster build times and significantly optimized CI/CD pipeline performance.

2. Updated SDK Module Name

Due to a package naming bug, the module name used for importing the SDK in your Swift files has been corrected to align with the new package structure.

Previous Import StatementNew Import Statement (v1.0.0)
import RingierAdimport RingierAdSDK

Action Required

Update all Swift files that use the SDK to reflect the new module name:

swift
// Before
import RingierAd

// After
import RingierAdSDK

3. RingierAdSettings Renamed to RingierAdSDKSettings

In version 1.0.0, the RingierAdSettings class has been replaced by the RingierAdSDKSettings struct, and you now create an instance of this struct.

Action Required

Update all usages from directly setting RingierAdSettings to creating an instance of RingierAdSDKSettings with the appropriate parameters.

swift
// Before
let settings = RingierAdSettings(
    configUrl: "https://example.com/config")!,
)

// After
let settings = RingierAdSDKSettings(
    configURL: URL(string: "https://example.com/config")!,
    logLevel: .debug,
    debug: true
)

4. Logging System Changes

The internal logging mechanism has been switched to use Apple's native Logger from the os package. This required a change in the log level enumeration.

Renamed Log Level Enumeration The previous RingierAdLogLevel enum has been renamed to RingierAdSDKLoggerLevel.

Enumeration Value Changes

The new RingierAdSDKLoggerLevel enum aligns with standard system log levels and replaces the previous custom values.

Old RingierAdLogLevel ValueClosest New RingierAdSDKLoggerLevel Value
.verbose.debug or .info
.error.error
.none(Remove log configuration, as logging is now controlled via the standard OS level)
.custom(...)(No direct replacement, use standard levels)
---New .critical, .fault, .notice, .warning

Action Required

Locate any code where you configure the SDK's logging and update the value

swift
let settings: RingierAdSettings = RingierAdSettings(
    configUrl: configURL,
    logLevel: .debug,
    debug: false
)
RingierAd.start(settings: settings)

5. Interstitial API Change

The public signature for showing an interstitial ad has been updated. The completion handler now returns a Bool indicating success or failure, instead of the Google Ad Manager (GAMInterstitialAd) object.

Previous API Signature

swift
class func showInterstitialAd(
    params: RingierAdInterstitialParams,
    controller: UIViewController,
    completion: @escaping (GAMInterstitialAd) -> Void
)

New API Signature

swift
public static func showInterstitialAd(
    params: RingierAdInterstitialParams,
    controller: UIViewController,
    completion: @escaping (Bool) -> Void
)

Action Required

Update all calls to showInterstitialAd to accept the new Bool completion handler

swift
// Before
RingierAd.showInterstitialAd(params: adParams, controller: self) { interstitialAd in
    // Handle the GAMInterstitialAd object
}

// After
RingierAdSDK.showInterstitialAd(params: adParams, controller: self) { success in
    if success {
        // Interstitial ad was shown successfully
    } else {
        // Interstitial ad failed to show
    }
}

6. New Audio Session Management Function

Version 1.0.0 introduces a new static function to manage the underlying Google Mobile Ads SDK's audio session behavior. This is crucial for apps that manage the AVAudioSession themselves (e.g., streaming apps, media players).

New function signature

swift
public static func setAudioSession(isApplicationManaged: Bool)

Purpose

This function sets the audioSessionIsApplicationManaged property on the Google Mobile Ads SDK's audio/video manager.

Set isApplicationManaged to true if your application is responsible for configuring and managing the AVAudioSession. This prevents the Google Mobile Ads SDK from interfering with your app's audio settings when playing video ads.

Set isApplicationManaged to false (default behavior) to let the Google Mobile Ads SDK manage the audio session for video ads.

Action Required

If your application handles its own audio session (e.g., using AVPlayer), you must call this function with true early in your app lifecycle (e.g., in application(_:didFinishLaunchingWithOptions:))

swift
import RingierAdSDK

// To ensure your application's audio session is preserved:
RingierAdSDK.setAudioSession(isApplicationManaged: true)

7. Video Functions Deprecated - Use VMAP/VAST Instead

Version 1.0.0 deprecates the existing video ad functions:

  • public static func getSSAIVASTJson(...) -> [String: Any]?
  • public static func getSSAIVAST(...) -> URL?
  • public static func getGoogleDAIJson(...) -> [String: Any]?

Action Required

Replace any usage of deprecated video functions with the new VMAP/VAST implementation:

swift
// Before (Deprecated)
// RingierAd.getSSAIVAST(...)
// RingierAd.getGoogleDAIJson(...)

// After (Use VMAP)
let adUrl = RingierAdSDK.getVMAPVAST(
    channel: "Sport",
    formats: ["PREROLL_1", "MIDROLL_1"],
    adbreaks: "0,60,120",
    vtype: "shortform",
    keywords: ["tag": ["football"]],
    duration: 300,
    urlString: "https://example.com/sport/article-id1278.html"
)

if let url = adUrl {
    // Use the URL with your video player
    print("VMAP URL: \(url)")
}

// After (Use VAST)
let adUrl = RingierAdSDK.getNormalVAST(
    channel: "ROS"s,
    placementOrAlias: "video1",
    pageType: "article",
    keywords: ["tag": ["football"]],
    duration: 300,
    urlString: "https://example.com/sport/article-id1278.html"
)