MAAdapterError.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. //
  2. // MAAdapterError.h
  3. // AppLovinSDK
  4. //
  5. // Created by Thomas So on 11/13/18.
  6. //
  7. #import <AppLovinSDK/MAError.h>
  8. NS_ASSUME_NONNULL_BEGIN
  9. /**
  10. * This enum contains possible error codes that should be returned by the mediation adapter.
  11. */
  12. @interface MAAdapterError : MAError
  13. /**
  14. * The mediation adapter can not load an ad because of no fill.
  15. */
  16. @property (class, nonatomic, readonly) NSInteger errorCodeNoFill;
  17. @property (class, nonatomic, readonly) MAAdapterError *noFill;
  18. /**
  19. * The mediation adapter failed to load an ad for an unspecified reason.
  20. */
  21. @property (class, nonatomic, readonly) NSInteger errorCodeUnspecified;
  22. @property (class, nonatomic, readonly) MAAdapterError *unspecified;
  23. /**
  24. * The mediation adapter can not load an ad because it is currently in an invalid state.
  25. */
  26. @property (class, nonatomic, readonly) NSInteger errorCodeInvalidLoadState;
  27. @property (class, nonatomic, readonly) MAAdapterError *invalidLoadState;
  28. /**
  29. * The mediation adapter can not load an ad because it is currently not configured correctly.
  30. */
  31. @property (class, nonatomic, readonly) NSInteger errorCodeInvalidConfiguration;
  32. @property (class, nonatomic, readonly) MAAdapterError *invalidConfiguration;
  33. /**
  34. * The mediation adapter can not load an ad because of a bad request.
  35. */
  36. @property (class, nonatomic, readonly) NSInteger errorCodeBadRequest;
  37. @property (class, nonatomic, readonly) MAAdapterError *badRequest;
  38. /**
  39. * The mediation adapter can not load an ad because the SDK is not initialized yet.
  40. */
  41. @property (class, nonatomic, readonly) NSInteger errorCodeNotInitialized;
  42. @property (class, nonatomic, readonly) MAAdapterError *notInitialized;
  43. /**
  44. * The mediation adapter can not load an ad because of a timeout.
  45. */
  46. @property (class, nonatomic, readonly) NSInteger errorCodeTimeout;
  47. @property (class, nonatomic, readonly) MAAdapterError *timeout;
  48. /**
  49. * The mediation adapter can not load an ad because it can not detect an active internet connection.
  50. */
  51. @property (class, nonatomic, readonly) NSInteger errorCodeNoConnection;
  52. @property (class, nonatomic, readonly) MAAdapterError *noConnection;
  53. /**
  54. * The mediation adapter did not have an ad ready in time for showing.
  55. */
  56. @property (class, nonatomic, readonly) NSInteger errorCodeAdNotReady;
  57. @property (class, nonatomic, readonly) MAAdapterError *adNotReady;
  58. /**
  59. * The mediation adapter ran into a remote server error.
  60. */
  61. @property (class, nonatomic, readonly) NSInteger errorCodeServerError;
  62. @property (class, nonatomic, readonly) MAAdapterError *serverError;
  63. /**
  64. * The mediation adapter ran into an unspecified internal error.
  65. */
  66. @property (class, nonatomic, readonly) NSInteger errorCodeInternalError;
  67. @property (class, nonatomic, readonly) MAAdapterError *internalError;
  68. /**
  69. * The mediation adapter has timed out while collecting a signal.
  70. */
  71. @property (class, nonatomic, readonly) NSInteger errorCodeSignalCollectionTimeout;
  72. @property (class, nonatomic, readonly) MAAdapterError *signalCollectionTimeout;
  73. /**
  74. * The mediation adapter does not support signal collection.
  75. */
  76. @property (class, nonatomic, readonly) NSInteger errorCodeSignalCollectionNotSupported;
  77. @property (class, nonatomic, readonly) MAAdapterError *signalCollectionNotSupported;
  78. /**
  79. * The mediation adapter ran into a WebView-related error.
  80. */
  81. @property (class, nonatomic, readonly) NSInteger errorCodeWebViewError;
  82. @property (class, nonatomic, readonly) MAAdapterError *webViewError;
  83. /**
  84. * The mediation adapter ran into an expired ad.
  85. */
  86. @property (class, nonatomic, readonly) NSInteger errorCodeAdExpired;
  87. @property (class, nonatomic, readonly) MAAdapterError *adExpiredError;
  88. /**
  89. * The mediation ad frequency capped.
  90. */
  91. @property (class, nonatomic, readonly) NSInteger errorCodeAdFrequencyCapped;
  92. @property (class, nonatomic, readonly) MAAdapterError *adFrequencyCappedError;
  93. /**
  94. * The mediation adapter ran into an error while displaying rewarded ad.
  95. */
  96. @property (class, nonatomic, readonly) NSInteger errorCodeRewardError;
  97. @property (class, nonatomic, readonly) MAAdapterError *rewardError;
  98. /**
  99. * The mediation adapter failed to load a native ad because of missing required assets.
  100. */
  101. @property (class, nonatomic, readonly) NSInteger errorCodeMissingRequiredNativeAdAssets;
  102. @property (class, nonatomic, readonly) MAAdapterError *missingRequiredNativeAdAssets;
  103. /**
  104. * The mediation ad failed to load because an Activity context was required, but missing.
  105. */
  106. @property (class, nonatomic, readonly) NSInteger errorCodeMissingViewController;
  107. @property (class, nonatomic, readonly) MAAdapterError *missingViewController;
  108. /*
  109. * The mediation adapter failed to display the ad.
  110. */
  111. @property (class, nonatomic, readonly) NSInteger errorCodeAdDisplayFailedError;
  112. @property (class, nonatomic, readonly) MAAdapterError *adDisplayFailedError;
  113. + (instancetype)errorWithCode:(NSInteger)code;
  114. + (instancetype)errorWithCode:(NSInteger)code errorString:(NSString *)errorString;
  115. + (instancetype)errorWithNSError:(NSError *)error;
  116. + (instancetype)errorWithAdapterError:(MAAdapterError *)error
  117. mediatedNetworkErrorCode:(NSInteger)mediatedNetworkErrorCode
  118. mediatedNetworkErrorMessage:(NSString *)mediatedNetworkErrorMessage;
  119. + (instancetype)errorWithCode:(NSInteger)code
  120. errorString:(NSString *)errorString
  121. mediatedNetworkErrorCode:(NSInteger)mediatedNetworkErrorCode
  122. mediatedNetworkErrorMessage:(NSString *)mediatedNetworkErrorMessage;
  123. - (instancetype)init NS_UNAVAILABLE;
  124. @end
  125. @interface MAAdapterError(ALDeprecated)
  126. + (instancetype)errorWithAdapterError:(MAAdapterError *)error thirdPartySdkErrorCode:(NSInteger)thirdPartySdkErrorCode thirdPartySdkErrorMessage:(NSString *)thirdPartySdkErrorMessage
  127. __deprecated_msg("This method has been deprecated in v11.4.0 and will be removed in a future SDK version. Please use -[MAAdapterError errorWithAdapterError:mediatedNetworkErrorCode:mediatedNetworkErrorMessage:] instead.");
  128. + (instancetype)errorWithCode:(NSInteger)code errorString:(NSString *)errorString thirdPartySdkErrorCode:(NSInteger)thirdPartySdkErrorCode thirdPartySdkErrorMessage:(NSString *)thirdPartySdkErrorMessage
  129. __deprecated_msg("This method has been deprecated in v11.4.0 and will be removed in a future SDK version. Please use -[MAAdapterError errorWithCode:errorString:mediatedNetworkErrorCode:mediatedNetworkErrorMessage:] instead.");
  130. @end
  131. NS_ASSUME_NONNULL_END