ALAdViewEventDelegate.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. //
  2. // ALAdViewEventDelegate.h
  3. // AppLovinSDK
  4. //
  5. // Created by Thomas So on 6/23/17.
  6. // Copyright © 2020 AppLovin Corporation. All rights reserved.
  7. //
  8. @class ALAd;
  9. @class ALAdView;
  10. NS_ASSUME_NONNULL_BEGIN
  11. /**
  12. * This enum contains possible error codes that are returned when the ad view fails to display an ad.
  13. */
  14. typedef NS_ENUM(NSInteger, ALAdViewDisplayErrorCode)
  15. {
  16. /**
  17. * The ad view failed to display an ad for an unspecified reason.
  18. */
  19. ALAdViewDisplayErrorCodeUnspecified
  20. };
  21. /**
  22. * This protocol defines a listener for ad view events.
  23. */
  24. @protocol ALAdViewEventDelegate <NSObject>
  25. @optional
  26. /**
  27. * The SDK invokes this method after the ad view begins to present fullscreen content.
  28. *
  29. * The SDK invokes this method on the main UI thread.
  30. *
  31. * Note: Some banners, when clicked, will expand into fullscreen content, whereupon the SDK will call this method.
  32. *
  33. * @param ad Ad for which the ad view presented fullscreen content.
  34. * @param adView Ad view that presented fullscreen content.
  35. */
  36. - (void)ad:(ALAd *)ad didPresentFullscreenForAdView:(ALAdView *)adView;
  37. /**
  38. * The SDK invokes this method as the fullscreen content is about to be dismissed.
  39. *
  40. * The SDK invokes this method on the main UI thread.
  41. *
  42. * @param ad Ad for which the fullscreen content is to be dismissed.
  43. * @param adView Ad view that contains the ad for which the fullscreen content is to be dismissed.
  44. */
  45. - (void)ad:(ALAd *)ad willDismissFullscreenForAdView:(ALAdView *)adView;
  46. /**
  47. * The SDK invokes this method after the fullscreen content is dismissed.
  48. *
  49. * The SDK invokes this method on the main UI thread.
  50. *
  51. * @param ad Ad for which the fullscreen content is dismissed.
  52. * @param adView Ad view that contains the ad for which the fullscreen content is dismissed.
  53. */
  54. - (void)ad:(ALAd *)ad didDismissFullscreenForAdView:(ALAdView *)adView;
  55. /**
  56. * The SDK invokes this method when the user is about to be taken out of the application after the user clicks on the ad.
  57. *
  58. * The SDK invokes this method on the main UI thread.
  59. *
  60. * @param ad Ad for which the user will be taken out of the application.
  61. * @param adView Ad view that contains the ad for which the user will be taken out of the application.
  62. */
  63. - (void)ad:(ALAd *)ad willLeaveApplicationForAdView:(ALAdView *)adView;
  64. /**
  65. * The SDK invokes this method when the user returns to the application after the user clicks on the ad.
  66. *
  67. * The SDK invokes this method on the main UI thread.
  68. *
  69. * @param ad Ad from which the user will return to the application.
  70. * @param adView Ad view that contains the ad from which the user will return to the application.
  71. */
  72. - (void)ad:(ALAd *)ad didReturnToApplicationForAdView:(ALAdView *)adView;
  73. /**
  74. * The SDK invokes this method if the ad view fails to display an ad.
  75. *
  76. * The SDK invokes this method on the main UI thread.
  77. *
  78. * @param ad Ad that the ad view failed to display.
  79. * @param adView Ad view that failed to display the ad.
  80. * @param code Error code that specifies the reason why the ad view failed to display the ad.
  81. */
  82. - (void)ad:(ALAd *)ad didFailToDisplayInAdView:(ALAdView *)adView withError:(ALAdViewDisplayErrorCode)code;
  83. @end
  84. NS_ASSUME_NONNULL_END