TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | Commercial |
ReleasedLast Release | Sep 2015 |
Maintained by Med Amine Ben Salah, Yecine Dhouib, Admin MNG Ads.
ADDING FILES TO YOUR PROJECT
ADDING FRAMEWORK TO YOUR PROJECT
WE RECOMMEND FOLLOW THIS DEMO
CREATE "libMng-perf.a" FILE
ADD BANNER
#import "Mngperf.h"
.<MngPerfBannerViewDelegate>
after UIViewController
@property (strong, nonatomic) MngPerfBannerView *bannerView;
if (!self.bannerView) {
self.bannerView = [[MngPerfBannerView alloc] initWithFrame:CGRectZero];
// size does not matter yet
// Don't trigger an Advert load when setting delegate
self.bannerView.allowDelegateAssigmentToRequestAd = NO;
self.bannerView.delegate = self;
self.bannerView.backgroundColor = [UIColor clearColor];
self.bannerView.refreshAnimation = UIViewAnimationTransitionFlipFromLeft;
self.bannerView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin;
[self.view addSubview:self.bannerView];
}
self.bannerView.requestURL = YOUR_MNG_PERF_REQUEST_URL;
[self.bannerView setLocationWithLatitude:48.5 longitude:10.01];
self.bannerView.mraid = 1;
self.bannerView.identifiers = [NSDictionary dictionaryWithObjectsAndKeys:@"1234567890", UDID, @"5742", USER_ID, nil];
self.bannerView.gender = @"M";
self.bannerView.age = 28;
self.bannerView.zip = 5022;
self.bannerView.openLandingInSafari = @"0";
self.bannerView.adRequestTimeOut = @"5.0";
[self.bannerView requestAd];
- (NSString *)publisherIdForMngperfBannerView:(MngPerfBannerView *)banner {
return PUBLISHER_ID_BANNER;
}
- (void)mngperfBannerViewDidLoadMngperfAd:(MngPerfBannerView *)banner {
NSLog(@"Mperf Banner: did load ad");
[self.view addSubview:banner];
}
- (void)mngperfBannerView:(MngPerfBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {
NSLog(@"Mperf Banner: did fail to load ad: %@", [error localizedDescription]);
}
ADD INTERSTITIAL
<MngPerfVideoInterstitialViewControllerDelegate>
after UIViewController
@property (strong, nonatomic) MngPerfVideoInterstitialViewController *videoInterstitialViewController;
if(!self.videoInterstitialViewController) {
// Create, add Interstitial/Video Ad View Controller and add view to view hierarchy
self.videoInterstitialViewController = [[MngPerfVideoInterstitialViewController alloc] init];
// Assign delegate
self.videoInterstitialViewController.delegate = self;
// Defaults to NO. Set to YES to get locationAware Adverts
self.videoInterstitialViewController.locationAwareAdverts = YES;
}
self.videoInterstitialViewController.requestURL = YOUR_MNG_PERF_REQUEST_URL;
self.videoInterstitialViewController.mraid = 1;
self.videoInterstitialViewController.identifiers = [NSDictionary dictionaryWithObjectsAndKeys:[model deviceID], UDID, nil];
self.videoInterstitialViewController.interstitialCloseButton = @"1";
self.videoInterstitialViewController.interstitialCloseButtonPosition = @"2";
self.videoInterstitialViewController.openLandingInSafari = @"0";
[self.videoInterstitialViewController requestAd];
[self.view addSubview:self.videoInterstitialViewController.view];
- (NSString *)publisherIdForMngperfVideoInterstitialView:(MngPerfVideoInterstitialViewController *)videoInterstitial {
return PUBLISHER_ID_INTERSTITIAL;
}
- (void)mngperfVideoInterstitialViewDidLoadMngperfAd:(MngPerfVideoInterstitialViewController *)videoInterstitial advertTypeLoaded:(MngperfAdType)advertType {
NSLog(@"Mperf Interstitial: did load ad");
// Means an advert has been retrieved and configured.
// Display the ad using the presentAd method and ensure you pass back the advertType
[videoInterstitial presentAd:advertType];
}
- (void)mngperfVideoInterstitialView:(MngPerfVideoInterstitialViewController *)banner didFailToReceiveAdWithError:(NSError *)error {
NSLog(@"Mperf Interstitial: did fail to load ad: %@", [error localizedDescription]);
}