GADCustomEventBannerDelegate.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //
  2. // GADCustomEventBannerDelegate.h
  3. // Google Mobile Ads SDK
  4. //
  5. // Copyright 2012 Google Inc. All rights reserved.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import <UIKit/UIKit.h>
  9. #import "GoogleMobileAdsDefines.h"
  10. @protocol GADCustomEventBanner;
  11. /// Call back to this delegate in your custom event. You must call customEventBanner:didReceiveAd:
  12. /// when there is an ad to show, or customEventBanner:didFailAd: when there is no ad to show.
  13. /// Otherwise, if enough time passed (several seconds) after the SDK called the requestBannerAd:
  14. /// method of your custom event, the mediation SDK will consider the request timed out, and move on
  15. /// to the next ad network.
  16. @protocol GADCustomEventBannerDelegate<NSObject>
  17. /// Your Custom Event object must call this when it receives or creates an ad view.
  18. - (void)customEventBanner:(id<GADCustomEventBanner>)customEvent didReceiveAd:(UIView *)view;
  19. /// Your Custom Event object must call this when it fails to receive or create the ad view. Pass
  20. /// along any error object sent from the ad network's SDK, or an NSError describing the error. Pass
  21. /// nil if not available.
  22. - (void)customEventBanner:(id<GADCustomEventBanner>)customEvent didFailAd:(NSError *)error;
  23. /// Your Custom Event object should call this when the user touches or "clicks" the ad to initiate
  24. /// an action. When the SDK receives this callback, it reports the click back to the mediation
  25. /// server.
  26. - (void)customEventBannerWasClicked:(id<GADCustomEventBanner>)customEvent;
  27. /// The rootViewController that you set in GADBannerView. Use this UIViewController to show a modal
  28. /// view when a user taps on the ad.
  29. @property(nonatomic, readonly) UIViewController *viewControllerForPresentingModalView;
  30. /// When you call the following methods, the call will be propagated back to the
  31. /// GADBannerViewDelegate that you implemented and passed to GADBannerView.
  32. /// Your Custom Event should call this when the user taps an ad and a modal view appears.
  33. - (void)customEventBannerWillPresentModal:(id<GADCustomEventBanner>)customEvent;
  34. /// Your Custom Event should call this when the user dismisses the modal view and the modal view is
  35. /// about to go away.
  36. - (void)customEventBannerWillDismissModal:(id<GADCustomEventBanner>)customEvent;
  37. /// Your Custom Event should call this when the user dismisses the modal view and the modal view has
  38. /// gone away.
  39. - (void)customEventBannerDidDismissModal:(id<GADCustomEventBanner>)customEvent;
  40. /// Your Custom Event should call this method when a user action will result in App switching.
  41. - (void)customEventBannerWillLeaveApplication:(id<GADCustomEventBanner>)customEvent;
  42. #pragma mark Deprecated
  43. - (void)customEventBanner:(id<GADCustomEventBanner>)customEvent
  44. clickDidOccurInAd:(UIView *)view
  45. GAD_DEPRECATED_MSG_ATTRIBUTE("Use customEventBannerWasClicked:.");
  46. @end