MANativeAdDelegate.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // MANativeAdDelegate.h
  3. // AppLovinSDK
  4. //
  5. // Created by Andrew Tian on 7/14/21.
  6. //
  7. @class MAAd;
  8. @class MAError;
  9. @class MANativeAdView;
  10. NS_ASSUME_NONNULL_BEGIN
  11. /**
  12. * This protocol defines a listener to be notified about native ad events.
  13. */
  14. @protocol MANativeAdDelegate <NSObject>
  15. /**
  16. * The SDK invokes this method when a new native ad has been loaded.
  17. *
  18. * @param nativeAdView The native ad view that the SDK successfully loaded.
  19. * May be @c nil if a manual native ad is loaded without a view.
  20. * You can create and render the native ad view using @code -[MANativeAdLoader renderNativeAdView:withAd:] @endcode.
  21. * @param ad The ad that was loaded.
  22. */
  23. - (void)didLoadNativeAd:(nullable MANativeAdView *)nativeAdView forAd:(MAAd *)ad;
  24. /**
  25. * The SDK invokes this method when a native ad could not be retrieved.
  26. *
  27. * <b>Common error codes:</b><table>
  28. * <tr><td>204</td><td>no ad is available</td></tr>
  29. * <tr><td>5xx</td><td>internal server error</td></tr>
  30. * <tr><td>negative number</td><td>internal errors</td></tr></table>
  31. *
  32. * @param adUnitIdentifier The ad unit ID that the SDK failed to load an ad for.
  33. * @param error An object that encapsulates the failure info.
  34. */
  35. - (void)didFailToLoadNativeAdForAdUnitIdentifier:(NSString *)adUnitIdentifier withError:(MAError *)error;
  36. /**
  37. * The SDK invokes this method when the native ad is clicked.
  38. *
  39. * The SDK invokes this method on the main UI thread.
  40. *
  41. * @param ad The ad that was clicked.
  42. */
  43. - (void)didClickNativeAd:(MAAd *)ad;
  44. @optional
  45. /**
  46. * The SDK invokes this method when the native ad expires.
  47. *
  48. * The SDK invokes this method on the main UI thread.
  49. *
  50. * @param ad The ad that expired.
  51. */
  52. - (void)didExpireNativeAd:(MAAd *)ad;
  53. @end
  54. NS_ASSUME_NONNULL_END