AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
03/20/13 02:11 AM (12 years ago)

Revmob full page ads - IOS

I have just added Revmob to my ios app, but the full page ads come up on startup, which is too quick. Is there any way to delay them?
 
Absentia
buzztouch Evangelist
Profile
Posts: 960
Reg: Oct 20, 2011
Alaska
20,600
like
03/20/13 07:32 AM (12 years ago)
Sure, 1. add this line to your delegate.h - -(void)showMyAd; 2. then add this method somewhere in your delegate.m - -(void)showMyAd{ [[RevMobAds session] showFullscreen]; } 3. finally, you just need to use this line of code to call the method with however long of a delay you want...paste this wherever you would normally call the ad (such as inside didFinishLaunchingWithOptions) and change the number on the end to reflect however many seconds and tenths of a second you want the delay to be - [self performSelector:@selector(showMyAd) withObject:nil afterDelay:2.0];
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
03/20/13 07:57 AM (12 years ago)
Thanks @Absentia, I made changes to my appdelegate.m and h files but I am currently stuck at step 2 with error "use of undeclared identifier showMyAd" I tried adding an import to my appdelegate.h in the .m, but it didn't help. I'm not much of a programmer and I can't see why the error is there.
 
Absentia
buzztouch Evangelist
Profile
Posts: 960
Reg: Oct 20, 2011
Alaska
20,600
like
03/20/13 08:26 AM (12 years ago)
Hmm,,you are probably pasting the showMyAd method inside of another method. In other words, you have to make sure it is not inside of any curly brackets. If that doesn't make sense then I can post a screenshot later
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
03/20/13 08:46 AM (12 years ago)
Aha! - that did the trick. I dropped the timed line of code into appDidBecomeActive and the result is exactly what I was looking for. Thanks hugely @Absentia btw, do you have any idea how often the full page ad pop up and if that is adjustable? Cheers, Alan
 
Absentia
buzztouch Evangelist
Profile
Posts: 960
Reg: Oct 20, 2011
Alaska
20,600
like
03/20/13 10:53 AM (12 years ago)
If you have it in appDidBecomeActive then the ad will show every single time (when the app first launches, and then every time it launches from the background) - if you want it to show only when the app first launches then you need to put the code inside appDidFinishLaunchingWithOptions I know there is a way to define more specifically how often you want a certain line of code to run - such as [showAd every 'x' number of launches] - but I'm not sure how to accomplish that. I'm interested to know myself..you may want to make a whole new thread about that one
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
03/20/13 11:06 AM (12 years ago)
It was done for Android (courtesy of Sandeep) - I can give you the notes I made for edits in the Android BT_activity_base.java file - it might be similarish and you might be able to translate this? 4.1 Add the following import statements to the others at the top of the file :- import android.app.Activity; import com.revmob.RevMob; // Create public static variables and initialise public static final int INVISIBLE = 4; public static final int VISIBLE = 0; private static String APPLICATION_ID = "Your_App_ID"; private static int session = 1; // Was 0, but don’t want app start with a RevMob screen 4.3 Modify the onCreate method //onCreate @Override
public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); Add lines immediately beneath so that it now reads:- //onCreate @Override
public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); // Starting RevMob session if(session % 5==0){ revmob = RevMob.start(this, APPLICATION_ID); revmob.showFullscreen(this); } session++;
 
Absentia
buzztouch Evangelist
Profile
Posts: 960
Reg: Oct 20, 2011
Alaska
20,600
like
03/20/13 11:17 AM (12 years ago)
Unfortunately I'm Java illiterate :/ I'll try googling around and let you know if I come up with anything
 

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.