MANetworkResponseInfo.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //
  2. // MANetworkResponseInfo.h
  3. // AppLovinSDK
  4. //
  5. // Created by Thomas So on 10/30/21.
  6. //
  7. @class MAError;
  8. @class MAMediatedNetworkInfo;
  9. NS_ASSUME_NONNULL_BEGIN
  10. /**
  11. * This enum contains possible states of an ad in the waterfall the adapter response info could represent.
  12. */
  13. typedef NS_ENUM(NSInteger, MAAdLoadState)
  14. {
  15. /**
  16. * The AppLovin MAX SDK did not attempt to load an ad from this network in the waterfall because an ad higher in the waterfall loaded successfully.
  17. */
  18. MAAdLoadStateAdLoadNotAttempted,
  19. /**
  20. * An ad successfully loaded from this network.
  21. */
  22. MAAdLoadStateAdLoaded,
  23. /**
  24. * An ad failed to load from this network.
  25. */
  26. MAAdLoadStateAdFailedToLoad,
  27. };
  28. /**
  29. * This class represents an ad response in a waterfall.
  30. */
  31. @interface MANetworkResponseInfo : NSObject
  32. /**
  33. * The state of the ad that this @c MAAdapterResponseInfo object represents. For more info, see the @c MAAdLoadState enum.
  34. */
  35. @property (nonatomic, assign, readonly) MAAdLoadState adLoadState;
  36. /**
  37. * The mediated network that this adapter response info object represents.
  38. */
  39. @property (nonatomic, strong, readonly) MAMediatedNetworkInfo *mediatedNetwork;
  40. /**
  41. * The credentials used to load an ad from this adapter, as entered in the AppLovin MAX dashboard.
  42. */
  43. @property (nonatomic, copy, readonly) NSDictionary<NSString *, id> *credentials;
  44. /**
  45. * Whether or not this response is from a bidding request.
  46. */
  47. @property (nonatomic, assign, readonly, getter=isBidding) BOOL bidding;
  48. /**
  49. * The amount of time the network took to load (either successfully or not) an ad, in seconds. If an attempt to load an ad has not been made (i.e. the @c loadState is @c MAAdLoadStateAdLoadNotAttempted), the value will be @c -1.
  50. */
  51. @property (nonatomic, assign, readonly) NSTimeInterval latency;
  52. /**
  53. * The ad load error this network response resulted in. Will be @c nil if an attempt to load an ad has not been made or an ad was loaded successfully (i.e. the @c loadState is NOT @c MAAdLoadStateAdFailedtoLoad).
  54. */
  55. @property (nonatomic, strong, readonly, nullable) MAError *error;
  56. - (instancetype)init NS_UNAVAILABLE;
  57. + (instancetype)new NS_UNAVAILABLE;
  58. @end
  59. NS_ASSUME_NONNULL_END