Home / MMA News

MMA News

// Import the SDK header file and declare that you are implementing // the FBInterstitialAdDelegate protocol: #import @interface MyViewController : UIViewController // Other code might go here... @end // Add a function in your View Controller that initializes the interstitialAd: - (void)loadInterstitial { FBInterstitialAd *interstitialAd = [[FBInterstitialAd alloc] initWithPlacementID:@"158627561295013_160501201107649"]; interstitialAd.delegate = self; [interstitialAd loadAd]; } // Now that you have added the code to load the ad, add the following functions // to display the ad once it is loaded and to handle loading failures: - (void)interstitialAdDidLoad:(FBInterstitialAd *)interstitialAd { NSLog(@"Interstitial ad is loaded and ready to be displayed"); // You can now display the full screen ad using this code: [interstitialAd showAdFromRootViewController:self]; } - (void)interstitialAd:(FBInterstitialAd *)interstitialAd didFailWithError:(NSError *)error { NSLog(@"Interstitial ad is failed to load with error: %@", error); }