Upgrade Guide
To Install the latest HyprMX SDK with CocoaPods, a dependency manager for Swift and Objective-C Cocoa projects, update the HyprMX dependency in your Podfile to:
pod 'HyprMX', '6.2.0'
HyprMX 6.0.0+ supports CocoaPods 1.10+
To manually update the framework, follow the steps below.
1. Remove the existing HyprMX.xcframework in the project navigation bar on the left side of the screen.

3. Drag and drop the HyprMX.xcframework (available in the zip) into your Xcode project, making sure that the files are copied and verify target membership.

4. Select your Project File and the Target. In the "General" tab, drag the HyprMX.xcframework from the File Explorer into the "Frameworks, Libraries, and Embedded Content" section.
5. Set the Embed setting to "Embed & Sign".

HyprMX’s
ageRestrictedUser
flag assists publishers with child-directed treatment of users to support compliance with applicable regional laws and regulations such as COPPA, GDPR and Apple App Store policies.HyprMX provides an Initialization API with an
ageRestrictedUser
parameter. If the user requires child-directed treatment under applicable laws and policies, set this parameter to true.If your app is primarily directed at children, indicate to your HyprMX Account Manager so the app can be designated as a child-directed app in the backend. Additionally, you may use the
ageRestrictedUser
flag to prevent access to IDFA for end-users flagged as children.If your app is directed at a mixed audience, including children, use the
ageRestrictedUser
flag to appropriately flag any user who is considered a child under applicable jurisdiction as age-restricted user to prevent access to IDFA for end-users flagged as children.Swift
Objective-C
HyprMX.initialize(withDistributorId: "Your Distributor ID",
userId: "Your User's ID",
consentStatus: <HyprConsentStatus>, // If you don't have consent status for the user, set this to CONSENT_STATUS_UNKNOWN
ageRestrictedUser: false, // If you don't know the user is age restricted, set this to false
initializationDelegate: self)
[HyprMX initializeWithDistributorId:@"Your Distributor ID"
userId:@"Your User's ID"
consentStatus: // If you don't have consent status for the user, set this to CONSENT_STATUS_UNKNOWN
ageRestrictedUser:NO // If you don't know the user is age restricted, set this to false
initializationDelegate:self];
The 6.0.0 SDK introduces a new delegate callback for notification of ad display errors. This updated API returns an
NSError
object with an error code and description, for improved debugging.Swift
Objective-C
func adDisplayError(_ error: Error, placement: HyprMXPlacement)
- (void)adDisplayError:(nonnull NSError *)error
placement:(nonnull HyprMXPlacement *)placement;
This callback will eventually replace the existing callback
adDisplayErrorForPlacement: error:
which returns an enum HyprMXError
, however both callbacks are optional and currently supported by the SDK.When upgrading your
HyprMXPlacementDelegate
, you can access the HyprMXError
code from the error object's code
property:Swift
Objective-C
let nsError = error as NSError
let hyprMXError:HyprMXError = HyprMXError(UInt32(nsError.code))
- (void)adDisplayError:(nonnull NSError *)error
placement:(nonnull HyprMXPlacement *)placement {
// Access error code
HyprMXError hyprError = (HyprMXError)error.code;
// print error description
NSLog(@"Display Error: %@", error.localizedDescription);
}
Last modified 9d ago