RevMob全屏广告在iOS上崩溃

时间:2013-05-09 01:03:44

标签: ios cocos2d-iphone revmob

如果我点击全屏广告并在广告有时间打开Safari或AppStore之前将其关闭,应用程序崩溃,并出现以下错误:

[RevMob] Initializing Fullscreen.
[RevMob] Ad received: (200).
[RevMob] Fullscreen clicked.
[RevMob] Loading iTunes url.
[RevMob] Fullscreen closed.
[RevMob] Opening iTunes.
 ***** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'**

如果有一个加载屏幕阻止用户互动,而RevMob需要时间采取不会发生的行动......我试图用加载屏幕覆盖广告,但我无法做到这一点......是否有任何解决方案?

-

我有2个iVars来控制revMob:

RevMobFullscreen* _revMobFullScreen;
BOOL _revMobFullScreenLoaded;

我正在以这种方式预加载全屏广告:

- (void)cacheFullScreenRevMob{

    //Get rid of old fullscreen ad and create a new one
    //This is need in order to (re)load an fullscreen ad
    [_revMobFullScreen release], _revMobFullScreen = nil;
    _revMobFullScreen = [[RevMobAds session] fullscreen];
    [_revMobFullScreen retain];

    //Pre load the ad for the next time

    _revMobFullScreenLoaded = NO;

    [_revMobFullScreen loadWithSuccessHandler:^(RevMobFullscreen *fs) {
        _revMobFullScreenLoaded = YES;

    } andLoadFailHandler:^(RevMobFullscreen *fs, NSError *error) {
        _revMobFullScreenLoaded = NO;

    } onClickHandler:nil onCloseHandler:^{
        [self postNotificationOnMainThreadFullAdDidFinish];
    }];
}

然后,这就是我如何展示全屏revmob广告:

- (BOOL)showFullScreenRevMob{

    BOOL didShow = NO;
    if (_revMobFullScreenLoaded) {
        [_revMobFullScreen showAd];
        didShow = YES;
    }

    //Cache for the next time
    [self cacheFullScreenRevMob];

    return didShow;
}

1 个答案:

答案 0 :(得分:3)

编辑:作为@João的评论,这是在5.6.2版本上修复的错误