ALInterstitialAd.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. //
  2. // ALInterstitialAd.h
  3. //
  4. // Copyright © 2020 AppLovin Corporation. All rights reserved.
  5. //
  6. #import <AppLovinSDK/ALAdDisplayDelegate.h>
  7. #import <AppLovinSDK/ALAdLoadDelegate.h>
  8. #import <AppLovinSDK/ALAdVideoPlaybackDelegate.h>
  9. @class ALAd;
  10. @class ALSdk;
  11. NS_ASSUME_NONNULL_BEGIN
  12. /**
  13. * This class displays full-screen ads to the user.
  14. */
  15. @interface ALInterstitialAd : NSObject
  16. #pragma mark - Ad Delegates
  17. /**
  18. * An object that conforms to the @c ALAdLoadDelegate protocol. If you provide a value for @c adLoadDelegate in your instance, the SDK will notify
  19. * this delegate of ad load events.
  20. */
  21. @property (nonatomic, strong, nullable) id<ALAdLoadDelegate> adLoadDelegate;
  22. /**
  23. * An object that conforms to the @c ALAdDisplayDelegate protocol. If you provide a value for @c adDisplayDelegate in your instance, the SDK will
  24. * notify this delegate of ad show/hide events.
  25. */
  26. @property (nonatomic, strong, nullable) id<ALAdDisplayDelegate> adDisplayDelegate;
  27. /**
  28. * An object that conforms to the @c ALAdVideoPlaybackDelegate protocol. If you provide a value for @c adVideoPlaybackDelegate in your instance,
  29. * the SDK will notify this delegate of video start/finish events.
  30. */
  31. @property (nonatomic, strong, nullable) id<ALAdVideoPlaybackDelegate> adVideoPlaybackDelegate;
  32. #pragma mark - Loading and Showing Ads, Class Methods
  33. /**
  34. * Shows an interstitial over the application’s key window. This loads the next interstitial and displays it.
  35. */
  36. + (instancetype)show;
  37. /**
  38. * Gets a reference to the shared singleton instance.
  39. *
  40. * This method calls @code +[ALSdk shared] @endcode which requires that you have an SDK key defined in @code Info.plist @endcode.
  41. *
  42. * @warning If you use @code +[ALSdk sharedWithKey:] @endcode then you will need to use the instance methods instead.
  43. */
  44. + (instancetype)shared;
  45. #pragma mark - Loading and Showing Ads, Instance Methods
  46. /**
  47. * Shows an interstitial over the application’s key window. This loads the next interstitial and displays it.
  48. */
  49. - (void)show;
  50. /**
  51. * Shows the current interstitial over a given window and renders a specified ad loaded by @c ALAdService.
  52. *
  53. * @param ad The ad to render into this interstitial.
  54. */
  55. - (void)showAd:(ALAd *)ad;
  56. /**
  57. * Sets extra info to pass to the SDK.
  58. *
  59. * @param key Parameter key.
  60. * @param value Parameter value.
  61. */
  62. - (void)setExtraInfoForKey:(NSString *)key value:(nullable id)value;
  63. #pragma mark - Initialization
  64. /**
  65. * Initializes an instance of this class with an SDK instance.
  66. *
  67. * @param sdk The AppLovin SDK instance to use.
  68. */
  69. - (instancetype)initWithSdk:(ALSdk *)sdk;
  70. - (instancetype)init NS_UNAVAILABLE;
  71. + (instancetype)new NS_UNAVAILABLE;
  72. @end
  73. NS_ASSUME_NONNULL_END