Migrate to Version 6.4+
Please follow the below guide to migrate from the HyprMX SDK 6.x to 6.4+.
This guide applies to partners upgrading to version 6.4+ from pre-6.4 versions. No migration is needed if you're upgrading from 6.4+.
HyprMX SDK 6.4+ contains a revamp to our public API, streamlining our SDK's initialization and providing more focused callbacks and delegates. Additionally, we now provide modernized asynchronous APIs that you can opt into, and have removed the main thread requirement from all of our public methods.
SDK Migration
The HyprMX iOS SDK 6.x can be migrated to 6.4+ through CocoaPods or by Manual Migration.
CocoaPods
To migrate the HyprMX SDK with CocoaPods, update the pod to 6.4.5 in your Podfile:
pod 'HyprMX', '6.4.5'Run pod install from the terminal in the directory containing your Podfile.
Manual Migration
To manually migrate the framework, follow the steps below.
Download the SDK here and unzip the file.
Right-click on HyprMX.xcframework in your project navigator and select Show in Finder.

Drag and drop the new 6.4+ HyprMX.xcframework (available in the zip) into the folder that contains the 6.3 HyprMX.xcframework and replace the old one.

Fixing Your Broken Build
See below for migrations related to HyprMX SDK 6.4+.
Migrating HyprMX.initialize
The new SDK initializer now only requires a distributorId, and takes a completion closure or returns a Result depending on the API chosen:
Other parameters that used to be provided to the initialization API now have new setters. These parameters can now be set after initialization when the information is available. As a result, you will need to migrate the following parameters:
consentStatusageRestrictedUseruserID
Follow the steps below to migrate the parameters.
Migrating the consentStatus parameter
consentStatus parameterMigrating the ageRestrictedUser parameter
ageRestrictedUser parameterMigrating the userID parameter
userID parameterOur API no longer accepts user ID.
HyprMXInitializationDelegate
HyprMXInitializationDelegate has been replaced with async Result or completion closure. To migrate existing code:
Remove any references to HyprMXInitializationDelegate from your project.
When success is true, call your existing initializationDidComplete method or logic.
When success is false, call your existing initializationFailed method or logic.
Completion blocks are invoked from the same operation queue the SDK is called from, a slight behavioral difference between the async and completion variants.
Migrating HyprMXPlacement.isAdAvailable
If used in any Swift source files, remove trailing parenthesis from placementInstance.isAdAvailable
Migrating HyprMXPlacement.loadAd
loadAd doesn't use a delegate in HyprMX SDK 6.4+. Instead, it returns results via async result or completion based callbacks. To migrate existing code:
When success is true, invoke your former onAdAvailable implementation.
When success is false, invoke your former onAdNotAvailable implementation.
Completion blocks are invoked from the same operation queue the SDK is called from, a slight behavioral difference between the async and completion variants.
Migrating HyprMXPlacementDelegate
HyprMXPlacementDelegate has been renamed to HyprMXPlacementShowDelegate. The SDK takes the delegate as a parameter in showAd, and stops using that delegate instance after calling adDidClose. To migrate existing code:
Rename references to HyprMXPlacementDelegate to HyprMXPlacementShowDelegate
Pass the show delegate as the second parameter to showAd
If you need callbacks to adExpired then implement the HyprMXPlacementExpiredDelegate
And set the expired delegate on your placement:
If your project implemented HyprMXPlacementDelegate in Swift, then it needs a few adjustments:
Remove
forfromadWillstart:
Remove
foranddidFinishAdfromadDidCloseand replaceAny!withBool
Remove
adDisplayError(for placement: HyprMXPlacement, error hyprMXError: HyprMXError)Remove
Errorand the underscore fromadDisplayError(_ error: Any!, placement: HyprMXPlacement)
Remove
forfromadDidRewardand replace the twoAny!types withString?andInt
Remove
forfromadExpired
HyprMX SDK always holds weak references to delegates.
HyprMXBannerView.loadAd
loadAd doesn't use a delegate in HyprMX SDK 6.4+. Instead, it returns results via async or completion based paths. To migrate existing code:
When success is true, invoke your adDidLoad implementation
When success is false, invoke your adFailedToLoad:error: implementation
That's it! You're done with the migration.
Last updated
