Last updated
import UIKit
class ViewController: UIViewController, Adx3InterstitialDeleagte {
override func viewDidLoad() {
super.viewDidLoad()
loadInterstitialAd()
// Do any additional setup after loading the view.
}
func loadInterstitialAd() {
Adx3InterstitialAd.sharedManager().load(withPlacementID: "Your Placement ID", userId: "", delegate: self) { isSuccess in
}
}
}#import "Adx3Framework/Adx3Ad.h"
@interface ViewController()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self loadInterstitialAd];
}
- (void)loadInterstitialAd {
[[Adx3InterstitialAd sharedManager] loadAdWithPlacementID:@"Your Placement ID" userId:@"" delegate:self completionHandler:^(BOOL isReady) {
}];
}
@endimport UIKit
class ViewController: UIViewController, Adx3InterstitialDeleagte {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
}
extension ViewController {
func didFinishLoadingAD(withPlacementID placementID: String!) {
print("----Interstitial AD Load Finish----")
}
func didFailToLoadAD(withPlacementID placementID: String!, error: Error!) {
print("----\(error.debugDescription)----")
}
func interstitialDidShow(forPlacementID placementID: String!, extra: [AnyHashable : Any]!) {
}
func interstitialDidClick(forPlacementID placementID: String!, extra: [AnyHashable : Any]!) {
}
func interstitialDidClose(forPlacementID placementID: String!, extra: [AnyHashable : Any]!) {
}
func interstitialDidEndPlayingVideo(forPlacementID placementID: String!, extra: [AnyHashable : Any]!) {
}
func interstitialDidStartPlayingVideo(forPlacementID placementID: String!, extra: [AnyHashable : Any]!) {
}
func interstitialFailedToShow(forPlacementID placementID: String!, error: Error!, extra: [AnyHashable : Any]!) {
}
func interstitialDidFailToPlayVideo(forPlacementID placementID: String!, error: Error!, extra: [AnyHashable : Any]!) {
}
}#import "Adx3Framework/Adx3Ad.h"
@interface ViewController() <Adx3InterstitialDeleagte>
@end
@implementation ViewController
@end
#pragma mark - Adx3AdLoadingDelegate
- (void)didFinishLoadingADWithPlacementID:(NSString *)placementID {
NSLog(@"---Interstitial AD Load Finish----");
}
- (void)didFailToLoadADWithPlacementID:(NSString *)placementID error:(NSError *)error {
NSLog(@"----%@----", error.description);
}
#pragma mark - Adx3InterstitialDeleagte
-(void)interstitialDidShowForPlacementID:(NSString*)placementID extra:(NSDictionary*)extra {
}
-(void)interstitialFailedToShowForPlacementID:(NSString*)placementID error:(NSError*)error extra:(NSDictionary*)extra {
}
-(void)interstitialDidStartPlayingVideoForPlacementID:(NSString*)placementID extra:(NSDictionary*)extra {
}
-(void)interstitialDidEndPlayingVideoForPlacementID:(NSString*)placementID extra:(NSDictionary*)extra {
}
-(void)interstitialDidFailToPlayVideoForPlacementID:(NSString*)placementID error:(NSError*)error extra:(NSDictionary*)extra {
}
-(void)interstitialDidCloseForPlacementID:(NSString*)placementID extra:(NSDictionary*)extra {
}
-(void)interstitialDidClickForPlacementID:(NSString*)placementID extra:(NSDictionary*)extra {
}func showInterstitialAd() {
Adx3InterstitialAd.sharedManager().showInterstitial(in: self, delegate: self)
}- (void)showInterstitialAd {
[[Adx3InterstitialAd sharedManager] showInterstitialInViewController:self delegate:self];
}