RevMobAds委托问题

Far*_*eez 0 delegates ios ios6 revmob

我试图在我的AppDelegate中接收RevMobAdsDelegate事件并且它们没有被调用.看下面我做了什么:

1)实施RevMobAdsDelegate协议:

@interface MyiOSAppAppDelegate : UIResponder <UIApplicationDelegate, RevMobAdsDelegate>
Run Code Online (Sandbox Code Playgroud)

2)使用ID初始化RevMobAds:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // other code here..
    // Revmob initialization
    [RevMobAds startSessionWithAppID: @"SECRET_APP_ID"];
    // other code here..
}
Run Code Online (Sandbox Code Playgroud)

3)致电RevMob广告:

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    [[RevMobAds session] showFullscreen];
}
Run Code Online (Sandbox Code Playgroud)

4)声明RevMobAdsDelegate事件:

- (void) revmobAdDidFailWithError:(NSError *)error
{
    NSLog(@"1");
}

- (void) revmobAdDidReceive
{
    NSLog(@"2");
}

- (void) revmobAdDisplayed
{
    NSLog(@"3");
}

- (void) revmobUserClickedInTheAd
{
    NSLog(@"4");
}

- (void) revmobUserClosedTheAd
{
    NSLog(@"5");
}
Run Code Online (Sandbox Code Playgroud)

广告看起来很好,并没有问题,但没有上述功能被调用.我也试过了

[RevMobAds session] .delegate = self;

但什么都没发生.RevMobAds文档中没有提到最后一行,
但我仍然尝试过.任何人都可以帮助我如何调用这些事件?

这里的任何帮助将不胜感激.

Dio*_*o T 6

代表只能使用对象广告,请查看API文档.

但你可以使用这样的东西:

RevMobFullscreen *ad = [[RevMobAds session] fullscreen];
ad.delegate = self;
[ad showAd];
Run Code Online (Sandbox Code Playgroud)

或者您可以使用新块"委托":

 RevMobFullscreen *ad = [[RevMobAds session] fullscreen];
 [ad loadWithSuccessHandler:^(RevMobFullscreen *fs) {
   [fs showAd];
   NSLog(@"Ad loaded");
 } andLoadFailHandler:^(RevMobFullscreen *fs, NSError *error) {
   NSLog(@"Ad error: %@",error);
 } onClickHandler:^{
   NSLog(@"Ad clicked");
 } onCloseHandler:^{
   NSLog(@"Ad closed");
 }];
Run Code Online (Sandbox Code Playgroud)