Delegate

示例代码如下:


#import "ViewController.h"
#import <VungleSDK/VungleSDK.h>

@interface ViewController ()

@end

@implementation ViewController
- (void)viewDidLoad {
    [super viewDidLoad];
    NSError* error;
    VungleSDK* sdk = [VungleSDK sharedSDK];
    sdk.delegate=self;
    [sdk startWithAppId:@"YOUR_APP_ID" error:&error];

}
// 实现的回调
- (void)vungleSDKDidInitialize{
// 初始化成功
}

- (void)vungleSDKFailedToInitializeWithError:(NSError *)error{
// 初始化失败
}

- (void)vungleAdPlayabilityUpdate:(BOOL)isAdPlayable placementID:(nullable NSString *)placementID error:(nullable NSError *)error{
// 缓存广告成功或失败
}

- (void)vungleWillShowAdForPlacementID:(nullable NSString *)placementID{
// 广告开始播放
}
- (void)vungleWillCloseAdWithViewInfo:(VungleViewInfo *)info placementID:(NSString *)placementID{
// 广告即将关闭
}

- (void)vungleDidCloseAdWithViewInfo:(VungleViewInfo *)info placementID:(NSString *)placementID{
// 广告已经关闭,建议在此处开始缓存下一条广告
}

建议在广告已经关闭(DidClose)回调中开始缓存下一条广告:


- (void)vungleDidCloseAdWithViewInfo:(VungleViewInfo *)info placementID:(NSString *)placementID{
// 广告已经关闭,建议在此处开始缓存下一条广告
}
这篇文章有帮助吗?

Questions?

Need further assistance, feel free to reach out to us, we’re here to help!