0

我遇到了一个问题,我在我的 iOS 应用程序中添加了 Flurry SDK,并且希望每次用户单击 uiAlertView 的“确定”按钮时都显示全屏添加。问题是它不起作用。

因此,我尝试在没有 AlertView 的情况下尝试这样做,并且效果很好。

有人知道为什么单击 AlertView 后它不起作用。

// The call of the alertview
 UIAlertView *myAlert = [[UIAlertView alloc]     initWithTitle:NSLocalizedString(@"TitlePopupNewGame", nil) message:nil delegate:self     cancelButtonTitle:NSLocalizedString(@"CancelPopupNewGame", nil)     otherButtonTitles:NSLocalizedString(@"YesPopupNewGame", nil), nil];
    myAlert.tag = 1;
    myAlert.delegate = self;
    [myAlert show];

// Alertview method
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{

   if (alertView.tag == 1 && buttonIndex == 0){
        [self showInterstitial];
    }
}

// ShowInterstitial method
-(void) showInterstitial{
    if ([FlurryAds adReadyForSpace: @"Full screen banner"]) {
        [FlurryAds displayAdForSpace: @"Full screen banner"
                          onView:mv];

        [FlurryAds fetchAdForSpace:@"Full screen banner"
                         frame:mv.frame size:FULLSCREEN];
    } else {
        // fetch an ad
        [FlurryAds fetchAdForSpace:@"Full screen banner"
                         frame:mv.frame size:FULLSCREEN];
    }
}

谢谢

4

0 回答 0