Implement interstitial ads in iOS
Implement interstitial ads in your iOS app. Load ad content, display it through Objective-C or Swift code, and use a delegate to handle ad events.
Read time 1 minuteLast updated a day ago
Interstitial ad load example
UseUADSLoadConfigurationBuilderUADSInterstitialAd.load()UADSInterstitialAd@property (strong) UADSInterstitialAd *interstitialAd;UADSLoadConfigurationBuilder *builder =[[UADSLoadConfigurationBuilder alloc] initWithPlacementId:placementId];builder = [builder withMediationInfo:self.mediationInfo];builder = [builder withAdMarkup:bidResponse];[UADSInterstitialAd load:[builder build] completion:^(UADSInterstitialAd *ad, id<UnityAdsError> error) { if (error) { NSLog(@"Failed: %ld %@", (long)error.code, error.message); } else { self.interstitialAd = ad; }}];
Interstitial ad show example
Callshow()UADSInterstitialAdUADSShowConfigurationUADSInterstitialShowDelegateshowDidStartshowDidClickshowDidCompleteshowDidFail@interface MyDelegate : NSObject <UADSInterstitialShowDelegate>@end@implementation MyDelegate- (void)showDidStart:(UADSInterstitialAd *)unityAd {}- (void)showDidClick:(UADSInterstitialAd *)unityAd {}- (void)showDidComplete:(UADSInterstitialAd *)unityAd with:(UADSShowFinishState)finishState {}- (void)showDidFail:(UADSInterstitialAd *)unityAd error:(id<UnityAdsError>)error {}@endUADSShowConfigurationBuilder *builder =[[UADSShowConfigurationBuilder alloc] init];builder = [builder withViewController:viewController];[self.interstitialAd show:[builder build] delegate:delegate];