ALAdRewardDelegate.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // ALAdRewardDelegate.h
  3. // AppLovinSDK
  4. //
  5. //
  6. // Copyright © 2020 AppLovin Corporation. All rights reserved.
  7. //
  8. @class ALAd;
  9. NS_ASSUME_NONNULL_BEGIN
  10. /**
  11. * This protocol defines a listener that listens to rewarded video events.
  12. */
  13. @protocol ALAdRewardDelegate <NSObject>
  14. @required
  15. /**
  16. * The SDK invokes this method if a user viewed a rewarded video and their reward was approved by the AppLovin server.
  17. *
  18. * If you use reward validation for incentivized videos, the SDK invokes this method if it contacted AppLovin successfully. This means the SDK believes the
  19. * reward is legitimate and you should award it.
  20. *
  21. * <b>Tip:</b> refresh the user’s balance from your server at this point rather than relying on local data that could be tampered with on jailbroken devices.
  22. *
  23. * The @c response @c NSDictionary will typically include the keys @c "currency" and @c "amount", which point to @c NSStrings that contain the name and amount of the
  24. * virtual currency that you may award.
  25. *
  26. * @param ad Ad that was viewed.
  27. * @param response Dictionary that contains response data from the server, including @c "currency" and @c "amount".
  28. */
  29. - (void)rewardValidationRequestForAd:(ALAd *)ad didSucceedWithResponse:(NSDictionary *)response;
  30. /**
  31. * The SDK invokes this method if it was able to contact AppLovin, but the user has already received the maximum number of coins you allowed per day in the web
  32. * UI, and so is ineligible for a reward.
  33. *
  34. * @param ad Ad that was viewed.
  35. * @param response Dictionary that contains response data from the server.
  36. */
  37. - (void)rewardValidationRequestForAd:(ALAd *)ad didExceedQuotaWithResponse:(NSDictionary *)response;
  38. /**
  39. * The SDK invokes this method if the AppLovin server rejected the reward request. The usual cause of this is that the user fails to pass an anti-fraud check.
  40. *
  41. * @param ad Ad that was viewed.
  42. * @param response Dictionary that contains response data from the server.
  43. */
  44. - (void)rewardValidationRequestForAd:(ALAd *)ad wasRejectedWithResponse:(NSDictionary *)response;
  45. /**
  46. * The SDK invokes this method if it was unable to contact AppLovin, and so AppLovin will not issue a ping to your S2S rewarded callback server.
  47. *
  48. * @param ad Ad that was viewed.
  49. * @param responseCode A failure code that corresponds to a constant defined in ALErrorCodes.h.
  50. */
  51. - (void)rewardValidationRequestForAd:(ALAd *)ad didFailWithError:(NSInteger)responseCode;
  52. @end
  53. NS_ASSUME_NONNULL_END