Advertise here

Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

ViewController usage issue? Ads and Alerts

nichlaspronichlaspro vordingborgPosts: 6New Users Noob

My app is using alerts and rewarded video ads and they are wrapped from objC.
They are both being showed from the current viewcontroller, for example when i got to show the alerts i use this:

UIViewController * viewController = [UIApplication sharedApplication].keyWindow.rootViewController;
[viewController presentViewController:alert animated:YES completion:nil];

That is all working but i know it cannot be displayed at the same time, the alerts and the video ads when they are using the same viewController. BUT now i have added a banner ad for my game which also runs from the current viewcontroller and the banner is running all the time. Therefore i cannot show rewarded videos or alerts while it is active(RevMob Banner).

How can i show the banner so that it won't affect the current viewController/so i can show alerts and rewarded video ads?

Have anybody else experience this issue, also when it says "warning: attempt to present which is already presenting"

Can anybody help?

Much appreciated!


  • BrianSlickBrianSlick Treadmill Desk Ninja Posts: 10,692Tutorial Authors, Registered Users @ @ @ @ @ @ @ @
    A view controller can only present 1 view controller at a time. So "attempt to present which is already presenting" means that view controller is already presenting 1, and you are trying to present another. You will have to dismiss the current one before you can present a new one.

    So if your banners are supposed to show all of the time, then presenting a view controller to show them is probably not the correct approach. You could use a container view controller such that your game is in the main part, and then your banner is in another part. Then you would be able to present the alerts.
    Professional iOS App Development. Available for hire.
    BriTer Ideas LLC - WWW | Facebook | Twitter | LinkedIn

    BTIKit | SlickShopper 2 | Leave a PayPal donation
Sign In or Register to comment.