Follow

Advanced Usage - Using Interstitial delegates

View original article on our GitHub

Set your view controller as a delegate so it is able to receive callbacks from the interstitial ad.

  1. Add the STADelegateProtocol to the header file

    @interface YourViewController : UIViewController <STADelegateProtocol>
    {
       STAStartAppAd* startAppAd;    
    } 
  2. Use "withDelegate:self" when calling the loadAd function: [startAppAd loadAd:STAAdType_Automatic withDelegate:self]

  3. Implement the following functions:

    - (void) didLoadAd:(STAAbstractAd*)ad;
    - (void) failedLoadAd:(STAAbstractAd*)ad withError:(NSError *)error;
    - (void) didShowAd:(STAAbstractAd*)ad;
    - (void) failedShowAd:(STAAbstractAd*)ad withError:(NSError *)error;
    - (void) didCloseAd:(STAAbstractAd*)ad;
    - (void) didClickAd:(STAAbstractAd*)ad;

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments