GADBannerViewDelegate.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // GADBannerViewDelegate.h
  3. // Google AdMob Ads SDK
  4. //
  5. // Copyright 2011 Google Inc. All rights reserved.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import "GADModules.h"
  9. @class GADRequestError;
  10. @class GADBannerView;
  11. /// Delegate for receiving state change messages from a GADBannerView such as ad requests
  12. /// succeeding/failing or when an ad has been clicked.
  13. @protocol GADBannerViewDelegate<NSObject>
  14. @optional
  15. #pragma mark Ad Request Lifecycle Notifications
  16. /// Called when an ad request loaded an ad. This is a good opportunity to add this view to the
  17. /// hierarchy if it has not been added yet. If the ad was received as a part of the server-side auto
  18. /// refreshing, you can examine the hasAutoRefreshed property of the view.
  19. - (void)adViewDidReceiveAd:(GADBannerView *)view;
  20. /// Called when an ad request failed. Normally this is because no network connection was available
  21. /// or no ads were available (i.e. no fill). If the error was received as a part of the server-side
  22. /// auto refreshing, you can examine the hasAutoRefreshed property of the view.
  23. - (void)adView:(GADBannerView *)view didFailToReceiveAdWithError:(GADRequestError *)error;
  24. #pragma mark Click-Time Lifecycle Notifications
  25. /// Called just before presenting the user a full screen view, such as a browser, in response to
  26. /// clicking on an ad. Use this opportunity to stop animations, time sensitive interactions, etc.
  27. ///
  28. /// Normally the user looks at the ad, dismisses it, and control returns to your application by
  29. /// calling adViewDidDismissScreen:. However if the user hits the Home button or clicks on an App
  30. /// Store link your application will end. On iOS 4.0+ the next method called will be
  31. /// applicationWillResignActive: of your UIViewController
  32. /// (UIApplicationWillResignActiveNotification). Immediately after that adViewWillLeaveApplication:
  33. /// is called.
  34. - (void)adViewWillPresentScreen:(GADBannerView *)adView;
  35. /// Called just before dismissing a full screen view.
  36. - (void)adViewWillDismissScreen:(GADBannerView *)adView;
  37. /// Called just after dismissing a full screen view. Use this opportunity to restart anything you
  38. /// may have stopped as part of adViewWillPresentScreen:.
  39. - (void)adViewDidDismissScreen:(GADBannerView *)adView;
  40. /// Called just before the application will background or terminate because the user clicked on an
  41. /// ad that will launch another application (such as the App Store). The normal
  42. /// UIApplicationDelegate methods, like applicationDidEnterBackground:, will be called immediately
  43. /// before this.
  44. - (void)adViewWillLeaveApplication:(GADBannerView *)adView;
  45. @end