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 class declaration

    class ViewController: UIViewController, STADelegateProtocol
  2. Use "withDelegate:self" when calling the loadAd function:startAppAd!.loadAd(STAAdType_Automatic, withDelegate: self)

  3. Implement the following functions:

    func didLoadAd(ad: STAAbstractAd) 
    func failedLoadAd(ad: STAAbstractAd, withError error: NSError)
    func didShowAd(ad: STAAbstractAd)
    func failedShowAd(ad: STAAbstractAd, withError error: NSError)
    func didCloseAd(ad: STAAbstractAd)
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request