//
|
// WAAdMobProxy.h
|
// WASdkIntf
|
//
|
// Created by lpw on 2024/5/27.
|
// Copyright © 2024 GHW-T-01. All rights reserved.
|
//
|
|
#import <Foundation/Foundation.h>
|
#import <UIKit/UIKit.h>
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
@protocol GADFullScreenContentDelegate;
|
|
/// Protocol for ads that present full screen content.
|
@protocol GADFullScreenPresentingAd <NSObject>
|
|
/// Delegate object that receives full screen content messages.
|
@property(nonatomic, weak, nullable) id<GADFullScreenContentDelegate> fullScreenContentDelegate;
|
|
@end
|
|
/// Delegate methods for receiving notifications about presentation and dismissal of full screen
|
/// content. Full screen content covers your application's content. The delegate may want to pause
|
/// animations or time sensitive interactions. Full screen content may be presented in the following
|
/// cases:
|
/// 1. A full screen ad is presented.
|
/// 2. An ad interaction opens full screen content.
|
@protocol GADFullScreenContentDelegate <NSObject>
|
|
@optional
|
|
/// Tells the delegate that an impression has been recorded for the ad.
|
- (void)adDidRecordImpression:(nonnull id<GADFullScreenPresentingAd>)ad;
|
|
/// Tells the delegate that a click has been recorded for the ad.
|
- (void)adDidRecordClick:(nonnull id<GADFullScreenPresentingAd>)ad;
|
|
/// Tells the delegate that the ad failed to present full screen content.
|
- (void)ad:(nonnull id<GADFullScreenPresentingAd>)ad
|
didFailToPresentFullScreenContentWithError:(nonnull NSError *)error;
|
|
/// Tells the delegate that the ad will present full screen content.
|
- (void)adWillPresentFullScreenContent:(nonnull id<GADFullScreenPresentingAd>)ad;
|
|
/// Tells the delegate that the ad will dismiss full screen content.
|
- (void)adWillDismissFullScreenContent:(nonnull id<GADFullScreenPresentingAd>)ad;
|
|
/// Tells the delegate that the ad dismissed full screen content.
|
- (void)adDidDismissFullScreenContent:(nonnull id<GADFullScreenPresentingAd>)ad;
|
|
/// Tells the delegate that the user earned a reward.
|
//- (void)userDidEarnReward:(nonnull NSMutableDictionary*)rewardDic;
|
|
|
#pragma mark - Unavailable
|
|
/// Unsupported. Delegates should implement adWillPresentFullScreenContent: instead.
|
- (void)adDidPresentFullScreenContent:(nonnull id<GADFullScreenPresentingAd>)ad NS_UNAVAILABLE;
|
|
@end
|
|
|
@interface WAAdMobProxy : NSObject
|
|
// 广告测试模式,会强制使用测试广告id
|
+ (void)setTestMode:(BOOL)isDebugMode;
|
|
|
/**
|
横幅广告
|
@param viewController 用于显示广告的视图控制器。
|
@param containerView 将包含横幅广告的视图。广告视图将作为此视图的子视图添加。
|
*/
|
+ (void)bindBannerAdWithViewController:(UIViewController *)viewController containerView:(UIView *)containerView;
|
|
|
// 插页广告
|
+ (BOOL)checkInterstitialAdReady;
|
+ (void)showInterstitialAdWithViewController:(UIViewController *)viewController withDelegate:( id<GADFullScreenContentDelegate>)delegate;
|
|
|
//开屏广告
|
+ (BOOL)checkAppOpenAdReady;
|
+ (void)showAppOpenAdWithViewController:(UIViewController *)viewController withDelegate:( id<GADFullScreenContentDelegate>)delegate;
|
|
|
/**
|
显示激励广告。
|
|
此方法在给定的视图控制器上显示激励广告,并处理广告的回调。
|
|
@param viewController 用于显示广告的视图控制器。
|
@param adName 广告名称或广告单元 ID。
|
@param extInfo 额外信息,可以用于调试或跟踪广告。
|
@param delegate 广告展示和关闭时的回调。
|
*/
|
+ (void)showRewardedAdWithViewController:(UIViewController *)viewController adName:(NSString *)adName extInfo:(NSString *)extInfo delegate:( id<GADFullScreenContentDelegate>)delegate;
|
|
|
|
|
//admob的ump隐私
|
|
+ (BOOL)checkUmpOptions;
|
+ (void)showUmpOptionsWithViewController:(UIViewController *)viewController consentGatheringComplete:(void (^)(NSError *_Nullable error))completionHandler;
|
|
|
|
|
|
|
|
@end
|
|
NS_ASSUME_NONNULL_END
|