MAAdDelegate.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. //
  2. // MAAdDelegate.h
  3. // AppLovinSDK
  4. //
  5. // Created by Thomas So on 8/10/18.
  6. // Copyright © 2020 AppLovin Corporation. All rights reserved.
  7. //
  8. @class MAAd;
  9. @class MAError;
  10. NS_ASSUME_NONNULL_BEGIN
  11. /**
  12. * This protocol defines a listener to be notified about ad events.
  13. */
  14. @protocol MAAdDelegate <NSObject>
  15. /**
  16. * The SDK invokes this method when a new ad has been loaded.
  17. *
  18. * @param ad The ad that was loaded.
  19. */
  20. - (void)didLoadAd:(MAAd *)ad;
  21. /**
  22. * The SDK invokes this method when an ad could not be retrieved.
  23. *
  24. * <b>Common error codes:</b><table>
  25. * <tr><td>204</td><td>no ad is available</td></tr>
  26. * <tr><td>5xx</td><td>internal server error</td></tr>
  27. * <tr><td>negative number</td><td>internal errors</td></tr></table>
  28. *
  29. * @param adUnitIdentifier The ad unit ID that the SDK failed to load an ad for.
  30. * @param error An object that encapsulates the failure info.
  31. */
  32. - (void)didFailToLoadAdForAdUnitIdentifier:(NSString *)adUnitIdentifier withError:(MAError *)error;
  33. /**
  34. * The SDK invokes this method when a full-screen ad is displayed.
  35. *
  36. * The SDK invokes this method on the main UI thread.
  37. *
  38. * @warning This method is deprecated for MRECs. It will only be called for full-screen ads.
  39. *
  40. * @param ad The ad that was displayed.
  41. */
  42. - (void)didDisplayAd:(MAAd *)ad;
  43. /**
  44. * The SDK invokes this method when a full-screen ad is hidden.
  45. *
  46. * The SDK invokes this method on the main UI thread.
  47. *
  48. * @warning This method is deprecated for MRECs. It will only be called for full-screen ads.
  49. *
  50. * @param ad The ad that was hidden.
  51. */
  52. - (void)didHideAd:(MAAd *)ad;
  53. /**
  54. * The SDK invokes this method when the ad is clicked.
  55. *
  56. * The SDK invokes this method on the main UI thread.
  57. *
  58. * @param ad The ad that was clicked.
  59. */
  60. - (void)didClickAd:(MAAd *)ad;
  61. /**
  62. * The SDK invokes this method when the ad failed to display.
  63. *
  64. * The SDK invokes this method on the main UI thread.
  65. *
  66. * @param ad The ad that the SDK failed to display for.
  67. * @param error An object that encapsulates the failure info.
  68. */
  69. - (void)didFailToDisplayAd:(MAAd *)ad withError:(MAError *)error;
  70. @optional
  71. - (void)didPayRevenueForAd:(MAAd *)ad
  72. __deprecated_msg("This callback has been deprecated and will be removed in a future SDK version. Please use -[MAAdRevenueDelegate didPayRevenueForAd:] instead.");
  73. - (void)didFailToLoadAdForAdUnitIdentifier:(NSString *)adUnitIdentifier withErrorCode:(NSInteger)errorCode
  74. __deprecated_msg("This callback has been deprecated and will be removed in a future SDK version. Please use -[MAAdDelegate didFailToLoadAdForAdUnitIdentifier:withError:] instead.");
  75. - (void)didFailToDisplayAd:(MAAd *)ad withErrorCode:(NSInteger)errorCode
  76. __deprecated_msg("This callback has been deprecated and will be removed in a future SDK version. Please use -[MAAdDelegate didFailToDisplayAd:withError:] instead.");
  77. @end
  78. NS_ASSUME_NONNULL_END