0

I've got a problem, I added Flurry SDK in my iOS app and want to show a full screen add each time when the user click in the "Ok" button of an uiAlertView. The problem is that it doesn't work.

So, I tried try to do it without the AlertView and it works perfectly.

Someone knows why it doesn't work after clicking on an 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];
    }
}

Thanks

  • You have to show us some code... we don't know what you did! Did you set the alertView delegate ??? – DrDev Jun 19 '13 at 13:19
  • I didn't set the AlertView delegate, but i tried now, and it's always not working. – David Goncalves Jun 19 '13 at 13:25
  • don't forget to add this in .h file and in the .m somewhere, myAlertview.delegate = self; – DrDev Jun 19 '13 at 13:32
  • Your alertview has a tag of 1, not 3 !! – DrDev Jun 19 '13 at 13:33
  • Note: always use breakpoints to know the source of the problem ! for example in this case, put the break point on the line where you have the if (alertView.tag ==3 && .....), first you will see if it ever reaches this method.. second you can find out why its not calling the method – DrDev Jun 19 '13 at 13:37
  • Sorry, I copied the wrong lines of the alertview method. The tag is 1 and showInterstitial is always running but the interstitial is never shown. I put also in the .h file and I have always the same problem. – David Goncalves Jun 19 '13 at 13:41
  • I put numbers of nslog and all seems to be correct. Each time I have an ad ready to be printed, but when the displayAdForSpace method comes the interstitial is never shown. – David Goncalves Jun 19 '13 at 13:44
  • 1
    I fixed it. The problem is that, when I click on the "Ok" button the alertview was already shown. To fix it, I put a delay. – David Goncalves Jun 19 '13 at 14:16

0 Answers0