MARewardedAdapterDelegate.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. //
  2. // MARewardedAdapterDelegate.h
  3. // AppLovinSDK
  4. //
  5. // Created by Thomas So on 8/10/18.
  6. // Copyright © 2019 AppLovin Corporation. All rights reserved.
  7. //
  8. #import <AppLovinSDK/MAAdapterDelegate.h>
  9. @class MAAdapterError;
  10. @class MAReward;
  11. NS_ASSUME_NONNULL_BEGIN
  12. /**
  13. * Protocol for adapters to forward ad load and display events to the MAX SDK for rewarded ads.
  14. */
  15. @protocol MARewardedAdapterDelegate <MAAdapterDelegate>
  16. /**
  17. * This method should called when an ad has been loaded.
  18. */
  19. - (void)didLoadRewardedAd;
  20. /**
  21. * This method should called when an ad has been loaded.
  22. *
  23. * @param extraInfo Extra info passed from the adapter.
  24. */
  25. - (void)didLoadRewardedAdWithExtraInfo:(nullable NSDictionary<NSString *, id> *)extraInfo;
  26. /**
  27. * This method should be called when an ad could not be loaded.
  28. *
  29. * @param adapterError An error that indicates the cause of the failure.
  30. */
  31. - (void)didFailToLoadRewardedAdWithError:(MAAdapterError *)adapterError;
  32. /**
  33. * This method should be called when the adapter has successfully displayed an ad to the user.
  34. */
  35. - (void)didDisplayRewardedAd;
  36. /**
  37. * This method should be called when the adapter has successfully displayed an ad to the user.
  38. *
  39. * @param extraInfo Extra info passed from the adapter.
  40. */
  41. - (void)didDisplayRewardedAdWithExtraInfo:(nullable NSDictionary<NSString *, id> *)extraInfo;
  42. /**
  43. * This method is should be called when an ad could not be displayed.
  44. *
  45. * @param adapterError An error that indicates the cause of the failure
  46. */
  47. - (void)didFailToDisplayRewardedAdWithError:(MAAdapterError *)adapterError;
  48. /**
  49. * This method is should be called when an ad could not be displayed.
  50. *
  51. * @param adapterError An error that indicates the cause of the failure
  52. * @param extraInfo Extra info passed from the adapter.
  53. */
  54. - (void)didFailToDisplayRewardedAdWithError:(MAAdapterError *)adapterError extraInfo:(nullable NSDictionary<NSString *, id> *)extraInfo;
  55. /**
  56. * This method should be called when the user has clicked adapter's ad.
  57. */
  58. - (void)didClickRewardedAd;
  59. /**
  60. * This method should be called when the user has clicked adapter's ad.
  61. *
  62. * @param extraInfo Extra info passed from the adapter.
  63. */
  64. - (void)didClickRewardedAdWithExtraInfo:(nullable NSDictionary<NSString *, id> *)extraInfo;
  65. /**
  66. * This method should be called when adapter's ad has been dismissed.
  67. */
  68. - (void)didHideRewardedAd;
  69. /**
  70. * This method should be called when adapter's ad has been dismissed.
  71. *
  72. * @param extraInfo Extra info passed from the adapter.
  73. */
  74. - (void)didHideRewardedAdWithExtraInfo:(nullable NSDictionary<NSString *, id> *)extraInfo;
  75. /**
  76. * This method should be invoked when a user should be granted a reward.
  77. *
  78. * @param reward The reward to be granted to the user.
  79. */
  80. - (void)didRewardUserWithReward:(MAReward *)reward;
  81. /**
  82. * This method should be invoked when a user should be granted a reward.
  83. *
  84. * @param reward The reward to be granted to the user.
  85. * @param extraInfo Extra info passed from the adapter.
  86. */
  87. - (void)didRewardUserWithReward:(MAReward *)reward extraInfo:(nullable NSDictionary<NSString *, id> *)extraInfo;
  88. @optional
  89. - (void)didStartRewardedAdVideo
  90. __deprecated_msg("This API is deprecated because not all adapters support this callback. Please use -[MARewardedAdapterDelegate didDisplayRewardedAd:] instead");
  91. - (void)didCompleteRewardedAdVideo
  92. __deprecated_msg("This API is deprecated because not all adapters support this callback. Please use -[MARewardedAdapterDelegate didHideRewardedAd:] instead");
  93. @end
  94. NS_ASSUME_NONNULL_END