//
|
// WAIAdmob.h
|
// WASdkIntf
|
//
|
// Created by lpw on 2024/5/28.
|
// Copyright © 2024 GHW-T-01. All rights reserved.
|
//
|
|
#import <Foundation/Foundation.h>
|
#import <WASdkIntf/WAAdMobProxy.h>
|
NS_ASSUME_NONNULL_BEGIN
|
|
@interface WAIAdmob : NSObject
|
// 广告测试模式,会强制使用测试广告id
|
- (void)setTestMode:(BOOL)isDebugMode;
|
|
|
|
// 横幅有关
|
/**
|
* 是否开启横幅广告
|
* @return YES表示开启,NO表示关闭
|
*/
|
- (BOOL)isOpenBannerAd;
|
|
/**
|
* 异步检查是否开启横幅广告
|
* @param completion 回调 block,返回广告启用状态和可能的错误
|
*/
|
- (void)isOpenBannerAdWithCompletion:(void(^)(BOOL isOpen, NSError *error))completion;
|
|
|
|
|
/**
|
* 检测横幅广告是非已缓存好
|
* @return YES表示广告已准备好,NO表示未准备好
|
*/
|
- (BOOL)checkBannerAdReady;
|
|
|
|
|
|
|
|
/**
|
@param viewController 用于显示广告的视图控制器。
|
@param containerView 将包含横幅广告的视图。广告视图将作为此视图的子视图添加。
|
*/
|
- (void)bindBannerAdWithViewController:(UIViewController *)viewController containerView:(UIView *)containerView ;
|
|
|
|
|
|
|
|
|
// 插页广告
|
|
|
/**
|
* 是否开启插页广告
|
* @return YES表示开启,NO表示关闭
|
*/
|
- (BOOL)isOpenInterstitialAd;
|
|
|
/**
|
* 异步检查是否开启插页广告
|
* @param completion 回调 block,返回广告启用状态和可能的错误
|
*/
|
- (void)isOpenInterstitialAdWithCompletion:(void(^)(BOOL isOpen, NSError *error))completion;
|
|
|
/**
|
* 检测插页广告是非已缓存好
|
* @return YES表示广告已准备好,NO表示未准备好
|
*/
|
- (BOOL)checkInterstitialAdReady;
|
- (void)showInterstitialAdWithViewController:(UIViewController *)viewController withDelegate:( id<GADFullScreenContentDelegate>)delegate;
|
|
|
//开屏广告
|
|
|
/**
|
* 是否开启开屏广告
|
* @return YES表示开启,NO表示关闭
|
*/
|
- (BOOL)isOpenAppOpenAd;
|
|
|
|
/**
|
* 异步检查是否开启开屏广告
|
* @param completion 回调 block,返回广告启用状态和可能的错误
|
*/
|
- (void)isOpenAppOpenAdWithCompletion:(void(^)(BOOL isOpen, NSError *error))completion;
|
|
|
|
/**
|
* 检测开屏广告是非已缓存好
|
* @return YES表示广告已准备好,NO表示未准备好
|
*/
|
- (BOOL)checkAppOpenAdReady;
|
- (void)showAppOpenAdWithViewController:(UIViewController *)viewController withDelegate:( id<GADFullScreenContentDelegate>)delegate;
|
|
|
|
|
/**
|
* 是否开启激励广告
|
* @return YES表示开启,NO表示关闭
|
*/
|
- (BOOL)isOpenRewardedWithAdName:(NSString *)adName;
|
|
/**
|
* 异步检查指定名称的激励视频广告是否可用
|
* @param adName 广告名称
|
* @param completion 回调 block,返回广告可用性状态和可能的错误
|
*/
|
- (void)isOpenRewardedWithAdName:(NSString *)adName
|
completion:(void(^)(BOOL isOpen, NSError *error))completion;
|
|
|
|
|
/**
|
* 检测激励广告是非已缓存好
|
* @return YES表示广告已准备好,NO表示未准备好
|
*/
|
|
- (BOOL)checkRewardedAdReady;
|
|
|
/**
|
显示激励广告。
|
|
此方法在给定的视图控制器上显示激励广告,并处理广告的回调。
|
|
@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;
|
|
|
|
/**
|
* 获取推广任务列表
|
* @param completion 完成回调,返回任务列表数组或错误信息
|
* 数组元素格式为:
|
* @{
|
* @"taskName": @"任务名称",
|
* @"taskStatus": @"0/1" // 0表示未完成,1表示已完成
|
* }
|
*/
|
- (void)fetchPromotionTasksWithCompletion:(void(^)(NSArray<NSDictionary *> * _Nullable tasks, NSError * _Nullable error))completion;
|
|
@end
|
|
NS_ASSUME_NONNULL_END
|