I used iAd framework for add ad on screen. I done with this by below code.
but I want ad in UIAertview. When UIAlertview comes user should be view company ad in that.
-(void)bannerViewDidLoadAd:(ADBannerView *)banner
{
if (!self.bannerIsVisible) {
[UIView beginAnimations:@"animatesAdBannerOn" context:NULL];
banner.frame = CGRectOffset(banner.frame, 0, -banner.frame.size.height); [UIView commitAnimations];
self.bannerIsVisible = YES;
}
}
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
if (!self.bannerIsVisible)
{
[UIView beginAnimations:@"animatesAdBannerOff" context:NULL];
banner.frame = CGRectOffset(banner.frame, 0, banner.frame.size.height); //rect, dx,dy
[UIView commitAnimations];
self.bannerIsVisible = NO;
}
}
I know we can customized UIAlertview. But not getting how to add iAd view in that. If anyone know’s help me.
If I’m understanding you correctly, you want to create an ad for your own company? You wouldn’t use iAd for this, as with iAd you have very little control over which advertisement is pushed to your banner. However you can make a new view with whatever you want in it (advertisement wise) and add it as a subview of your
UIAlertView. Now I am saying you CAN do this, but you probably shouldn’t. Modification of an alertView in this way will most likely be rejected by Apple.