MAAd.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. //
  2. // MAAd.h
  3. // AppLovinSDK
  4. //
  5. // Created by Thomas So on 8/10/18.
  6. // Copyright © 2020 AppLovin Corporation. All rights reserved.
  7. //
  8. #import <CoreGraphics/CoreGraphics.h>
  9. @class MAAdFormat;
  10. @class MAAdWaterfallInfo;
  11. @class MANativeAd;
  12. NS_ASSUME_NONNULL_BEGIN
  13. /**
  14. * This class represents an ad that has been served by AppLovin MAX.
  15. */
  16. @interface MAAd : NSObject
  17. /**
  18. * The format of this ad.
  19. */
  20. @property (nonatomic, strong, readonly) MAAdFormat *format;
  21. /**
  22. * The size of the AdView format ad, or @c CGSizeZero otherwise.
  23. */
  24. @property (nonatomic, assign, readonly) CGSize size;
  25. /**
  26. * The ad unit ID for which this ad was loaded.
  27. */
  28. @property (nonatomic, copy, readonly) NSString *adUnitIdentifier;
  29. /**
  30. * The ad network from which this ad was loaded.
  31. *
  32. * @see <a href="https://dash.applovin.com/documentation/mediation/ios/testing-networks/creative-debugger#network-name">MAX Integration Guide ⇒ iOS ⇒ Testing Networks ⇒ Creative Debugger ⇒ Network Name</a>
  33. */
  34. @property (nonatomic, copy, readonly) NSString *networkName;
  35. /**
  36. * The ad network placement for which this ad was loaded.
  37. */
  38. @property (nonatomic, copy, readonly) NSString *networkPlacement;
  39. /**
  40. * The creative id tied to the ad, if any. You can report creative issues to the corresponding ad network using this id.
  41. *
  42. * It may not be available until @c -[MAAdDelegate didDisplayAd:] is called.
  43. *
  44. * @see <a href="https://dash.applovin.com/documentation/mediation/ios/testing-networks/creative-debugger#creative-id">MAX Integration Guide ⇒ iOS ⇒ Testing Networks ⇒ Creative Debugger ⇒ Creative ID</a>
  45. *
  46. * @since 6.15.0
  47. */
  48. @property (nonatomic, copy, readonly, nullable) NSString *creativeIdentifier;
  49. /**
  50. * The Ad Review creative id tied to the ad, if any. You can report creative issues to our Ad review team using this id.
  51. *
  52. * It may not be available until @c -[MAAdDelegate didDisplayAd:] is called.
  53. *
  54. * @since 11.3.0
  55. */
  56. @property (nonatomic, copy, readonly, nullable) NSString *adReviewCreativeIdentifier;
  57. /**
  58. * The ad’s revenue amount. In the case where no revenue amount exists, or it is not available yet, will return a value of 0.
  59. */
  60. @property (nonatomic, assign, readonly) double revenue;
  61. /**
  62. * The precision of the revenue value for this ad.
  63. *
  64. * Possible values are:
  65. * - "publisher_defined" - If the revenue is the price assigned to the line item by the publisher.
  66. * - "exact" - If the revenue is the resulting price of a real-time auction.
  67. * - "estimated" - If the revenue is the price obtained by auto-CPM.
  68. * - "undefined" - If we do not have permission from the ad network to share impression-level data.
  69. * - "" - An empty string, if revenue and precision are not valid (for example, in test mode).
  70. */
  71. @property (nonatomic, copy, readonly) NSString *revenuePrecision;
  72. /**
  73. * The placement name that you assign when you integrate each ad format, for granular reporting in postbacks (e.g. "Rewarded_Store", "Rewarded_LevelEnd").
  74. */
  75. @property (atomic, copy, readonly, nullable) NSString *placement;
  76. /**
  77. * The underlying waterfall of ad responses.
  78. */
  79. @property (nonatomic, strong, readonly) MAAdWaterfallInfo *waterfall;
  80. /**
  81. * The latency of the mediation ad load request in seconds.
  82. */
  83. @property (nonatomic, assign, readonly) NSTimeInterval requestLatency;
  84. /**
  85. * For Native ads only. Get an instance of the @c MANativeAd containing the assets used to render the native ad view.
  86. */
  87. @property (nonatomic, strong, readonly, nullable) MANativeAd *nativeAd;
  88. /**
  89. * The DSP network that provided the loaded ad when the ad is served through AppLovin Exchange.
  90. */
  91. @property (nonatomic, copy, readonly, nullable) NSString *DSPName;
  92. /**
  93. * The DSP id network that provided the loaded ad when the ad is served through AppLovin Exchange.
  94. */
  95. @property (nonatomic, copy, readonly, nullable) NSString *DSPIdentifier;
  96. /**
  97. * Gets the ad value for a given key.
  98. *
  99. * @param key The key for the value you want to retrieve.
  100. *
  101. * @return The ad value corresponding to @c key, or @c nil if no value for that key exists.
  102. */
  103. - (nullable NSString *)adValueForKey:(NSString *)key;
  104. /**
  105. * Gets the ad value for a given key.
  106. *
  107. * @param key The key for the value you want to retrieve.
  108. * @param defaultValue The default value to return if the value for @c key does not exist or is @c nil.
  109. *
  110. * @return The ad value corresponding to @c key, or the default value if no value for that key exists.
  111. */
  112. - (nullable NSString *)adValueForKey:(NSString *)key defaultValue:(nullable NSString *)defaultValue;
  113. - (instancetype)init NS_UNAVAILABLE;
  114. + (instancetype)new NS_UNAVAILABLE;
  115. @end
  116. NS_ASSUME_NONNULL_END