Discussion Forums  >  RevMob Integration

Replies: 6    Views: 526

piggilypoo
Aspiring developer
Profile
Posts: 172
Reg: Jun 28, 2011
San Diego
5,120
09/04/13 09:09 PM (12 years ago)

How to move banner to the top in iOS?

Hello, Trying to setup revmob to work in my iOS buzztouch app but am having some problems. In the android version, I have it set to display a full screen ad when the user navigates to a custom HTML page from buzztouch. Using the iPhone guides, it didn't seem like there was an easy way to do this, so by default it displays a full screen ad when the app is active (or when the app first starts up), and then will show banner ads, which is fine. However, I use a tabbed layout for my app, and the revmob banner position is right on top of this, making navigation impossible. I tried following the revmob iOS documentation, which says to follow the documentation to learn how to move the position... but no where in the document is this information. Does anyone know how to move the Revmob banner so it displays at the top of the screen, instead of over the tabs? Thanks!
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
09/05/13 10:11 PM (12 years ago)
@piggilypoo: My solution should help you: I have walked through the code below in English: The object "ad" is initialized to the class method of RevMobAds session bannerView. The delegate (what the ad will call back to when it is displayed) is this class itself. Then take the object and prepare it for displaying. Now when it is time to display it, the delegate calls the class (itself) back under the function, "revmobAdDidReceive." Now the banner has to be initialized, so the iPhone goes to Core Graphics, and creates a rectangle at coordinates 0,0 to a certain width and certain height. Once these properties have been configured, it is added as a "Subview" to the screen. The part of the code you will want to alter is the CGMake(0,0). You should play around with setting the values until you find the right coordinates. These values are like coordinate pairs on a x/y axis. Code: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ad = [[[RevMobAds session] bannerView] retain]; ad.delegate = self; [ad loadAd]; - (void)revmobAdDidReceive { intermediateView.frame = CGRectMake(0,0, somewidth, someheight); ad.frame = intermediateView.bounds; [intermediateView addSubview:ad]; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sources: -Code Example from: http://stackoverflow.com/questions/14436829/set-revmob-banner-frame-for-iphone -Definition created by Jake Chasan Does this help? Jake
 
piggilypoo
Aspiring developer
Profile
Posts: 172
Reg: Jun 28, 2011
San Diego
5,120
like
10/01/13 11:29 AM (12 years ago)
Hey Jake, I'm having trouble trying to figure out where to place the code, or if it already exists, where to edit it. Right now the only buzztouch file that I have edited to show revmob is the app name_appDelegate.m file. Near the top i have the following code: //didFinishLaunchingWithOptions... -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ [RevMobAds startSessionWithAppID:@"myID"]; Near the middle of the file, I have the following code: //applicationDidBecomeActive... - (void)applicationDidBecomeActive:(UIApplication *)application{ [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"applicationDidBecomeActive%@", @""]]; [[RevMobAds session] showFullscreen]; [[RevMobAds session] showBanner]; I'm not sure where to place the code you mentioned.. everywhere I've tried doesn't work. Sorry, I'm an Xcode novice :)
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
10/02/13 03:36 PM (12 years ago)
Where did you initialize the revmob object? Probably looks like this: = [[[RevMobAds session] bannerView] retain]; Jake
 
piggilypoo
Aspiring developer
Profile
Posts: 172
Reg: Jun 28, 2011
San Diego
5,120
like
10/03/13 11:36 PM (12 years ago)
I'm not sure how to answer the question. In my previous post, I pasted the only revmob code I've added to my project. Adding the code you mentioned doesn't seem to work, and I thought maybe I'm trying to paste it into the wrong place.
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
10/07/13 11:26 AM (12 years ago)
Can you do a search of your entire project in Xcode and look up this: = [[[RevMobAds session] bannerView] retain]; There should be a class named RevMobAds.m (or something like this). That is where the above code will be most likely stored. Jake
 
piggilypoo
Aspiring developer
Profile
Posts: 172
Reg: Jun 28, 2011
San Diego
5,120
like
10/08/13 06:45 PM (12 years ago)
There's a RevMobAds.h but this file doesn't contain that code, and a search through my project doesn't turn it up either
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.