Mng-perf 5.1.2

Mng-perf 5.1.2

TestsTested
LangLanguage Obj-CObjective C
License Commercial
ReleasedLast Release Sep 2015

Maintained by Med Amine Ben Salah, Yecine Dhouib, Admin MNG Ads.



Mng-perf 5.1.2

  • By
  • MOBILENETWORKGROUP

MNG-PERF-1.png for IOS

ADDING FILES TO YOUR PROJECT

  • Add MRAID.bundle file to your project.
  • Add libMng-perf.a file to your project.
  • Add Mngperf.h file to your project.
  • Add MngPerfBannerView.h file to your project.
  • Add MngPerfVideoInterstitialViewController.h file to your project.

ADDING FRAMEWORK TO YOUR PROJECT

  • Add libz.dylib to your project.
  • Add SystemConfiguration.framework to your project.
  • Add EventKit.framework to your project.
  • Add EventKitUI.framework to your project.
  • Add CoreTelephony.framework to your project.
  • Add StoreKit.framework to your project.
  • Add AdSupport.framework to your project.
  • Add CoreGraphics.framework to your project.
  • Add CoreLocation.framework to your project.
  • Add MediaPlayer.framework to your project.
  • Add MessageUI.framework to your project.

WE RECOMMEND FOLLOW THIS DEMO

CREATE "libMng-perf.a" FILE

  • Build project for iOS device and simulator.
  • Open Terminal.
  • Set path to "/Users/user_name/Library/Developer/Xcode/DerivedData/my_project/Build/Products".
  • Execute this code in terminal "libtool -static -o libMng-perf.a Debug-iphoneos/libMng-perf.a Debug-iphonesimulator/libMng-perf.a"
  • You find the "libMng-perf.a" in "/Users/user_name/Library/Developer/Xcode/DerivedData/my_project/Build/Products"

ADD BANNER

  • Include Mng-perf-SDK wherever you need it with #import "Mngperf.h".
  • Go to your view controller ##.h ## and add <MngPerfBannerViewDelegate> after UIViewController
  • Create new property @property (strong, nonatomic) MngPerfBannerView *bannerView;
  • In your view controller ##.m## add this code when you want show the banner
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];
  • Add Mng-perfSdk banner delegate methods
- (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

  • Go to your view controller ##.h ## and add <MngPerfVideoInterstitialViewControllerDelegate> after UIViewController
  • Create new property @property (strong, nonatomic) MngPerfVideoInterstitialViewController *videoInterstitialViewController;
  • In your view controller ##.m## add this code when you want show the Interstitial
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];
  • Add Mng-perfSdk Interstitial delegate methods
- (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]);
}