MAAdFormat.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. //
  2. // MAAdFormat.h
  3. // AppLovinSDK
  4. //
  5. // Created by Thomas So on 8/10/18.
  6. // Copyright © 2020 AppLovin Corporation. All rights reserved.
  7. //
  8. NS_ASSUME_NONNULL_BEGIN
  9. /**
  10. * This class defines a format of an ad.
  11. */
  12. @interface MAAdFormat : NSObject <NSCopying>
  13. /**
  14. * Represents a 320×50 banner advertisement.
  15. */
  16. @property (class, nonatomic, strong, readonly) MAAdFormat *banner;
  17. /**
  18. * Represents a 300×250 rectangular advertisement.
  19. */
  20. @property (class, nonatomic, strong, readonly) MAAdFormat *mrec;
  21. /**
  22. * Represents a 728×90 leaderboard advertisement (for tablets).
  23. */
  24. @property (class, nonatomic, strong, readonly) MAAdFormat *leader;
  25. /**
  26. * Represents a full-screen advertisement.
  27. */
  28. @property (class, nonatomic, strong, readonly) MAAdFormat *interstitial;
  29. /**
  30. * Similar to @code +[MaxAdFormat interstitial] @endcode, except that it is shown upon opening the app.
  31. */
  32. @property (class, nonatomic, strong, readonly) MAAdFormat *appOpen;
  33. /**
  34. * Similar to @code +[MAAdFormat interstitial] @endcode except that users are given a reward at the end of the advertisement.
  35. */
  36. @property (class, nonatomic, strong, readonly) MAAdFormat *rewarded;
  37. /**
  38. * Represents a fullscreen ad that the user can skip or be granted a reward upon successful completion of the ad.
  39. */
  40. @property (class, nonatomic, strong, readonly) MAAdFormat *rewardedInterstitial;
  41. /**
  42. * Represents a native advertisement.
  43. */
  44. @property (class, nonatomic, strong, readonly) MAAdFormat *native;
  45. /**
  46. * String representing the name of this ad format. Sample values include "BANNER", "MREC", "INTER", "REWARDED", etc.
  47. */
  48. @property (nonatomic, copy, readonly) NSString *label;
  49. /**
  50. * The size of the AdView format ad, or @c CGSizeZero otherwise.
  51. */
  52. @property (nonatomic, assign, readonly) CGSize size;
  53. /**
  54. * Get the adaptive banner size for the screen width (with safe areas insetted) at the current orientation.
  55. *
  56. * <b>Note:</b> The height is the only adaptive dimension; the width spans the screen.
  57. *
  58. * <b>Note:</b> Only AdMob / Google Ad Manager currently has support for adaptive banners and the maximum height is 15% the height of the screen.
  59. *
  60. * @see <a href="https://dash.applovin.com/documentation/mediation/ios/getting-started/banners#adaptive-banners">MAX Integration Guide ⇒ iOS ⇒ Banners ⇒ Adaptive Banners</a>
  61. */
  62. @property (nonatomic, assign, readonly) CGSize adaptiveSize;
  63. /**
  64. * Get the adaptive banner size for the provided width at the current orientation.
  65. *
  66. * <b>Note:</b> The height is the only adaptive dimension; the width that you provide will be passed back to you in the returned size.
  67. *
  68. * <b>Note:</b> Only AdMob / Google Ad Manager currently has support for adaptive banners and the maximum height is 15% the height of the screen.
  69. *
  70. * @param width The width to retrieve the adaptive banner size for, in points.
  71. *
  72. * @return The adaptive banner size for the current orientation and width.
  73. *
  74. * @see <a href="https://dash.applovin.com/documentation/mediation/ios/getting-started/banners#adaptive-banners">MAX Integration Guide ⇒ iOS ⇒ Banners ⇒ Adaptive Banners</a>
  75. */
  76. - (CGSize)adaptiveSizeForWidth:(CGFloat)width;
  77. /**
  78. * Whether or not the ad format is fullscreen: that is, an interstitial, rewarded, or rewarded interstitial.
  79. */
  80. @property (nonatomic, assign, readonly, getter=isFullscreenAd) BOOL fullscreenAd;
  81. /**
  82. * Whether or not the ad format is one of the following: a banner, leader, or MREC.
  83. */
  84. @property (nonatomic, assign, readonly, getter=isAdViewAd) BOOL adViewAd;
  85. /**
  86. * Whether or not the ad format is a banner or leader.
  87. */
  88. @property (nonatomic, assign, readonly, getter=isBannerOrLeaderAd) BOOL bannerOrLeaderAd;
  89. /**
  90. * @return human-readable representation of the format.
  91. */
  92. @property (nonatomic, copy, readonly) NSString *displayName;
  93. - (instancetype)init NS_UNAVAILABLE;
  94. - (instancetype)new NS_UNAVAILABLE;
  95. @end
  96. NS_ASSUME_NONNULL_END