Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

87 rader
3.6 KiB

  1. // Copyright 2014 Google Inc. All Rights Reserved.
  2. #import <Foundation/Foundation.h>
  3. #import <GoogleMobileAds/GoogleMobileAds.h>
  4. #import "GADUTypes.h"
  5. /// A wrapper around GADBannerView. Includes the ability to create GADBannerView objects, load them
  6. /// with ads, and listen for ad events.
  7. @interface GADUBanner : NSObject
  8. /// Initializes a GADUBanner with specified width and height, positioned at either the top or
  9. /// bottom of the screen.
  10. - (id)initWithBannerClientReference:(GADUTypeBannerClientRef *)bannerClient
  11. adUnitID:(NSString *)adUnitID
  12. width:(CGFloat)width
  13. height:(CGFloat)height
  14. adPosition:(GADAdPosition)adPosition;
  15. /// Initializes a full-width GADUBanner, positioned at either the top or bottom of the screen.
  16. - (id)initWithSmartBannerSizeAndBannerClientReference:(GADUTypeBannerClientRef *)bannerClient
  17. adUnitID:(NSString *)adUnitID
  18. adPosition:(GADAdPosition)adPosition;
  19. /// Initializes a GADUBanner with specified width and height at the specified point.
  20. - (id)initWithBannerClientReference:(GADUTypeBannerClientRef *)bannerClient
  21. adUnitID:(NSString *)adUnitID
  22. width:(CGFloat)width
  23. height:(CGFloat)height
  24. customAdPosition:(CGPoint)customAdPosition;
  25. /// Initializes a full-width GADUBanner with specified width and height at the specified point.
  26. - (id)initWithSmartBannerSizeAndBannerClientReference:(GADUTypeBannerClientRef *)bannerClient
  27. adUnitID:(NSString *)adUnitID
  28. customAdPosition:(CGPoint)customAdPosition;
  29. /// A reference to the Unity banner client.
  30. @property(nonatomic, assign) GADUTypeBannerClientRef *bannerClient;
  31. /// A GADBannerView which contains the ad.
  32. @property(nonatomic, strong) GADBannerView *bannerView;
  33. /// The ad received callback into Unity.
  34. @property(nonatomic, assign) GADUAdViewDidReceiveAdCallback adReceivedCallback;
  35. /// The ad failed callback into Unity.
  36. @property(nonatomic, assign) GADUAdViewDidFailToReceiveAdWithErrorCallback adFailedCallback;
  37. /// The will present screen callback into Unity.
  38. @property(nonatomic, assign) GADUAdViewWillPresentScreenCallback willPresentCallback;
  39. /// The did dismiss screen callback into Unity.
  40. @property(nonatomic, assign) GADUAdViewDidDismissScreenCallback didDismissCallback;
  41. /// The will leave application callback into Unity.
  42. @property(nonatomic, assign) GADUAdViewWillLeaveApplicationCallback willLeaveCallback;
  43. // Returns the mediation adapter class name.
  44. @property(nonatomic, readonly, copy) NSString *mediationAdapterClassName;
  45. // Returns the height of the banner view in pixels.
  46. @property(nonatomic, readonly) CGFloat heightInPixels;
  47. // Returns the width of the banner view in pixels.
  48. @property(nonatomic, readonly) CGFloat widthInPixels;
  49. /// Makes an ad request. Additional targeting options can be supplied with a request object.
  50. - (void)loadRequest:(GADRequest *)request;
  51. /// Makes the GADBannerView hidden on the screen.
  52. - (void)hideBannerView;
  53. /// Makes the GADBannerView visible on the screen.
  54. - (void)showBannerView;
  55. /// Removes the GADBannerView from the view hierarchy.
  56. - (void)removeBannerView;
  57. /// Set the GADBannerView's position on screen using a standard position.
  58. - (void)setAdPosition:(GADAdPosition)adPosition;
  59. /// Set the GADBannerView's position on screen using a custom position.
  60. - (void)setCustomAdPosition:(CGPoint)customPosition;
  61. @end