GADCustomEventInterstitial.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // GADCustomEventInterstitial.h
  3. // Google Mobile Ads SDK
  4. //
  5. // Copyright 2012 Google Inc. All rights reserved.
  6. //
  7. #import <UIKit/UIKit.h>
  8. #import "GADCustomEventInterstitialDelegate.h"
  9. #import "GADCustomEventRequest.h"
  10. /// The protocol for a Custom Event of the interstitial type. Your Custom Event handler object for
  11. /// interstitial must implement this protocol. The requestInterstitialAd method will be called when
  12. /// mediation schedules your Custom Event to be executed.
  13. @protocol GADCustomEventInterstitial<NSObject>
  14. /// You should call back to the |delegate| with the results of the execution to ensure mediation
  15. /// behaves correctly. The delegate is assigned, not retained, to prevent memory leak caused by
  16. /// circular retention.
  17. ///
  18. /// Define the -delegate and -setDelegate: methods in your class.
  19. ///
  20. /// In your class's -dealloc method, remember to nil out the delegate.
  21. @property(nonatomic, weak) id<GADCustomEventInterstitialDelegate> delegate;
  22. /// This method is called by mediation when your Custom Event is scheduled to be executed. Your
  23. /// implementation should begin retrieval of the interstitial ad, usually from a backend server, or
  24. /// from an ad network SDK. Results of the execution should be reported back via the delegate. Note
  25. /// that you should wait until -presentFromRootViewController is called before displaying the
  26. /// interstitial ad. Do not automatically display the ad when you receive the ad. Instead, retain
  27. /// the ad and display it when presentFromRootViewController is called. |serverParameter| and
  28. /// |serverLabel| are the parameter and label configured in the AdMob mediation UI for the Custom
  29. /// Event. |request| contains information about the ad request, some of those are from GADRequest.
  30. - (void)requestInterstitialAdWithParameter:(NSString *)serverParameter
  31. label:(NSString *)serverLabel
  32. request:(GADCustomEventRequest *)request;
  33. /// Present the interstitial ad as a modal view using the provided view controller. This is called
  34. /// only after your Custom Event calls back to the delegate with the message
  35. /// -customEvent:didReceiveAd: .
  36. - (void)presentFromRootViewController:(UIViewController *)rootViewController;
  37. @end