There is no working code from my end, but I looked through the documentation and found catergory for UIViewController with iAd methods
Here
It seems you are mixing old code with new code.
From what I saw, I would suggest:
-(void)showFullScreenAd { //Check if already requesting ad if (requestingAd == NO) { [self requestInterstitialAdPresentation]; requestingAd = YES; } } -(void)viewDidLoad() { [super viewDidLoad]; // Any other setup. self.ADInterstitialPresentationPolicy = ADInterstitialPresentationPolicyManual }
This follows the new iOS7 implementation. Setting a policy in the viewDidLoad method allows the platform to pre-cache assets and run any ads from the iAd server. Ready, therefore, when the showFullScreenAd method is called, the advertisement must be ready.
You can also call the class method +(void)prepareInterstitialAds when loading the view or performing other data tasks, this allows you to use the resources of the preliminary cache of the Framework, if possible, which can mean subsequent requests faster.
To handle RevMob with an advertisement error: [self requestInterstitialAdPresentation]; returns a boolean, which means you can handle this and report a RevMob error, etc. When the ad was closed. It is best to do some KVO in the presentingFullScreenAd property for the ViewController. Which indicates whether it shows FullScreenAd, I believe that this is only iAd, Full Ad.
The reason you have such different results is because you have two ways to request and declare ads in the same view controller.
When an ad is presented "Portrait", [self requestInterstitialAdPresentation]; Failed to get the declaration, but the instance of ADInterstitialAd sent another request. This loaded because you do not set the frame to represent the instance, it does not know that it is intended for landscape and therefore a portrait version is presented. Since it is now presented in the view, the view does not know / does not care about what orientation it is in, therefore it is an advertising view based on its geometry.
When is the landscape below [self requestInterstitialAdPresentation]; . This top announcement is the announcement of this call. I'm not sure why the rest of the screen shows a landscape, unless it's something from the Framework, that is, [self requestInterstitialAdPresentation]; internally decides that it should be a landscape from the ViewControllers layout, so all subsequent ad requests match this if the VC orientation does not change again.
[EDIT] - I put together an example. This was made from memory / documentation, so it probably wonβt be 100% correct and most likely will not work with direct copy and paste. This should give an idea that also includes support for pre iOS7 versions
//.h @import UIKit; @import iAd; @interface MyInterstitialViewController : UIViewController <ADInterstitialAdDelegate> { } @property (strong) ADInterstitialAd *fullScreenAd; @end //.m
For reference.
The changes I made allow the Ad Framework to work the way you expect on all versions of iOS from 4.3 to 8.X
From iOS 4.3 - 6.X, the overall thread was:
Create an announcement, set it to delegate, submit and process in the delegate methods.
From 7 to 8.X (the previous presentation method in the UIViewController was deprecated in iOS 7, but deprecation means that previous methods work until the next version of X.0, as a rule.)
In this case, you request the Framework to declare through [UIViewController requestInterstitialAdPresentation]; method. The controller will create the view and present it if it has an advertisement. You no longer get delegate methods, "- (void) observValueForKeyPath: (NSString *) keyPath ofObject: (ID) object change: (NSDictionary *) change context: (void *) context"
the method essentially allows you to get a delegate call when the ad has finished serving so you can continue the logic of your application. In essence, calling the delegate is "AdDidFinish." But since we do not remove the observer until the controller is unloaded, there is logic to handle if a new advertisement was displayed.
This means that your VC logic should not check to see if a full-screen ad is constantly displayed.
You can still use the stream from iOS 4.3-6.8, but using the presentInView method. As described in the iAd Programming Guide, this should be used if you have a view of the content inside, then what I have outlined is a Transitional Announcement methodology.