iOS Interstitial

This section describes how to integrate with the AdFalcon’s iOS SDK in order to consume the services available by the network.

in order to integrate with the SDK, please perform the following steps:

Add ADFInterstitialAd to your ViewController header file

  1. Import the module of AdFalcon SDK “AdFalconSDK”.
  2. implement ADFInterstitialAdDelegate protocol and declare ADFInterstitialAd instance.

Below is an example of how the header should look like:

@import "AdFalconSDK";

@interface ViewController: UIViewController {
     ADFInterstitialAd * adfInterstitial;
}

Add ADFInterstitialAd to your ViewController implementation

  1. Add the following code in viewDidLoad method
//initialize ADFInterstitialAd
adfInterstitial = [[ADFInterstitialAd alloc] init];
    
//If you want to receive test ads
adView.testing = YES;
    
//load new interstitial
[adfInterstitial loadInterstitialWithSiteID:@"Your site ID" delegate:self];

 
Note:  If more information are available about the user, then it is recommended that you call the method below instead and pass the user information in ADFTargetingParams parameter in the same way this is handled in the Standard Banner Ad.

-(void) loadInterstitialWithSiteID:(NSString*) siteID 
        testing:(BOOL) testing 
        delegate:(NSObject *) delegate
        params:(ADFTargetingParams*) params;
  1. Add the following required delegate methods for the ADFInterstitialAdDelegate
-(void)adfInterstitialDidLoadAd: (ADFInterstitialAd*) adfInterstitial{
[adfInterstitial presentFromRootViewController:self]
}

-(void)adfInterstitialDidDismissScreen: (ADFInterstitialAd*) adfInterstitial{
}

-(void)adfInterstitial: (ADFInterstitialAd*) adfInterstitial didFailWithErrorCode:(int) code message:(NSString*)message{
switch (code) {
        case kADFAdViewErrorNoAdAvailabe:
            // No Ad Availabe
            break;
        case kADFAdViewErrorInvalidParam:
            // Invalid Param send to server 
            break;
        case kADFAdViewErrorMissingParam:
            // Missing Param send to server 
            break;
        case kADFAdViewErrorCommunication:
            //Communication with server failed or no internet
            break;
        default:	
            break;
    }
}