ALMediationAdapter.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. //
  2. // MAMediationAdapterBase.h
  3. // AppLovinSDK
  4. //
  5. // Created by Santosh Bagadi on 8/29/18.
  6. // Copyright © 2019 AppLovin Corporation. All rights reserved.
  7. //
  8. #import <AppLovinSDK/MAAdapter.h>
  9. #import <AppLovinSDK/MAAdapterResponseParameters.h>
  10. @class ALSdk;
  11. @class MAReward;
  12. NS_ASSUME_NONNULL_BEGIN
  13. @interface ALMediationAdapter : NSObject <MAAdapter>
  14. /**
  15. * Left here for backwards-compatibility purposes - to be removed when enough time passes
  16. * The AppLovin mediation tag to send to mediated ad networks.
  17. */
  18. @property (nonatomic, copy, readonly) NSString *mediationTag;
  19. // The AppLovin mediation tag to send to mediated ad networks.
  20. @property (class, nonatomic, copy, readonly) NSString *mediationTag;
  21. // Parent objects
  22. @property (atomic, weak, readonly) ALSdk *sdk;
  23. @property (atomic, copy, readonly) NSString *tag;
  24. - (instancetype)initWithSdk:(ALSdk *)sdk;
  25. - (instancetype)init NS_UNAVAILABLE;
  26. @end
  27. @interface ALMediationAdapter (RewardUtils)
  28. // AppLovin server-provided reward.
  29. @property (nonatomic, strong, readonly) MAReward *reward;
  30. /**
  31. * This property determines if the adapter should always reward the user.
  32. * Note: some networks let users opt out of a video/reward and have a corresponding callback for rewarding the user.
  33. *
  34. * @return if the adapter should always reward the user.
  35. */
  36. @property (nonatomic, assign, readonly, getter=shouldAlwaysRewardUser) BOOL alwaysRewardUser;
  37. /**
  38. * Creates a reward from the server parameters and configures any reward settings.
  39. */
  40. - (void)configureRewardForParameters:(id<MAAdapterResponseParameters>)parameters;
  41. @end
  42. @interface ALMediationAdapter (Logging)
  43. - (void)d:(NSString *)format, ...;
  44. - (void)i:(NSString *)format, ...;
  45. - (void)w:(NSString *)format, ...;
  46. - (void)e:(NSString *)format, ...;
  47. - (void)e:(NSString *)message becauseOf:(nullable NSException *)ex;
  48. - (void)userError:(NSString *)format, ...;
  49. - (void)userError:(NSString *)message becauseOf:(nullable NSException *)ex;
  50. - (void)log:(NSString *)format, ...;
  51. // Helper methods for Swift, since variadic arguments are not supported/necessary
  52. - (void)logDebug:(NSString *)message;
  53. - (void)logInfo:(NSString *)message;
  54. - (void)logWarn:(NSString *)message;
  55. - (void)logError:(NSString *)message;
  56. - (void)logUserError:(NSString *)message;
  57. @end
  58. @interface ALMediationAdapter (ALDeprecated)
  59. extern NSString *const kMAConfigKeyMuted __deprecated_msg("Adapters no longer support mute APIs.");
  60. @end
  61. NS_ASSUME_NONNULL_END