Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Status
Not open for further replies.

spiderguy84

macrumors regular
Original poster
Nov 12, 2009
108
0
How can I take the splash loading screen, usually Default.png, into something that will show the iad banner on it, forcing users to view an ad for 3 or 4 seconds before opening my app?
 
Your app takes 3 or 4 seconds to load?!

First of all, the Default.png is displayed by the OS while it waits for you to finish loading. It isn't a view that you have direct control over, so you cannot do this.

Second of all, I'm not sure you grasp the way ADBannerView works, since it won't display anything for a second or two while it connects to a server and gets add content.


If you really want to display a splash screen with an ad, you are going to have to hardcode the ad onto your Default.png. Meaning you won't be able to change your ad without submitting a new binary and you'll have to sell/track the revenue some other way.
 
Your app takes 3 or 4 seconds to load?!

First of all, the Default.png is displayed by the OS while it waits for you to finish loading. It isn't a view that you have direct control over, so you cannot do this.

1. you can tell you splash screen to hold for a little while.

2. You can tell a view with you own ad to show for a few seconds after launch

although you can display an ad it must be your own. The iAds can only be displayed in a 320*50 or 480*32 format.

If you are a paid developer i suggest you check out the WWDC videos from this year they have a few on iAds.
 
1. you can tell you splash screen to hold for a little while.

2. You can tell a view with you own ad to show for a few seconds after launch

although you can display an ad it must be your own. The iAds can only be displayed in a 320*50 or 480*32 format.

If you are a paid developer i suggest you check out the WWDC videos from this year they have a few on iAds.

1. You do not have control over the contents of the view, other than making the png file in the first place.

2. ... "Tell a view with your own ad to show for a few seconds after launch" I suppose so, but you would still have to hardcode in the ad contents (unless you wanted to make the user view a blank or default add while you fetch something from the network). You CANNOT have an ADBannerView showing while it has no content, at least not if you want to have it on the store. And you are correct, there are very limited size constraints on iAd views.
 
1. You do not have control over the contents of the view, other than making the png file in the first place.

2. ... "Tell a view with your own ad to show for a few seconds after launch" I suppose so, but you would still have to hardcode in the ad contents (unless you wanted to make the user view a blank or default add while you fetch something from the network). You CANNOT have an ADBannerView showing while it has no content, at least not if you want to have it on the store. And you are correct, there are very limited size constraints on iAd views.

What i meant was that you could load a view and have an NSTimer for 3-4 seconds to close it within that view you could create links and animations to create an appealing and working ad.
 
Actually now I'm curious, how can you tell the splash screen to hold for a defined amount of time? Without sleeping on the main thread or something...
 
Actually now I'm curious, how can you tell the splash screen to hold for a defined amount of time? Without sleeping on the main thread or something...
There are a number of possible solutions to achieve this end. The real question is: why would you want to delay your users from using your app?
 
Depends, a tenth of a second of having it up while I do something in the background might aleviate an annoying graphical bug I am experiencing with iOS4 (that wasn't in the previous builds)

So if there are so many ways, what are the most common?
 
The Default.png doesn't go away until [window makeKeyAndVisible] is called in application:didFinishLaunchingWithOptions:. I'd start by seeing what you could do before that call.

Curious, though: What is this graphical bug you are encountering? Perhaps there's a better way than splash-screen-tweaking to address the issue.
 
I don't have that call in my applicationDelegate, so unfortunately that doesn't help and probably wouldn't help.

Basically in previous versions of the SDK when apple sent the notification UIKeyboardWillShowNotification they had already created the keyboard view and were about to animate it onto the screen.

So I could just set its hidden property to YES and I would never see it.

NOW when apple does this they have either not created it, or they haven't added it to the view hierarchy so I can't find it yet, and thus my only good way of hiding the keyboard is to fire an NSTimer when I receive the notification and then hide the keyboard. No matter how small I make the NSTimer, I still see the keyboard START to animate up before it disappears.
 
I don't have that call in my applicationDelegate, so unfortunately that doesn't help and probably wouldn't help.
Really? What does your application:didFinishLaunchingWithOptions: look like then?

Basically in previous versions of the SDK when apple sent the notification UIKeyboardWillShowNotification they had already created the keyboard view and were about to animate it onto the screen.
Your app pops up the keyboard on startup (and you've coded to avoid that)? Why would it try to do that?
 
Nevermind I think I have just come up with a great way around it by looking at the documentation for UIResponder.

The reason I want this is because my UI has a very specific keyboard already displayed, kinda like a calculator. But I wanted to use a UITextView to enter my data into without the keyboard.... meaning I could still use the copy and paste functionality just insert commands on my own.

Please see http://www.youtube.com/watch?v=DnwHzT7BLjs for a overview of my app. What you don't see in the video is that I have a way to pull back up the keyboard if you need to enter text into the field.

As of 3.2 UIResponder subclasses have a property inputView that is initially nil. If you set it to a blank view it essentially does what I want, however setting it back to nil doesn't make the original keyboard come back.
This is why I initially rejected this approach when fixing my app up for iOS 4.

I have found a method in UIResponder -reloadInputViews which will bring back the normal keyboard if you call is after setting the inputView property back to nil.
 
Really? What does your application:didFinishLaunchingWithOptions: look like then?

Code:
- (void)applicationDidFinishLaunching:(UIApplication *)application {
    // Add the tab bar controller's current view as a subview of the window
    [window addSubview:tabBarController.view];
}
 
The simplist way (in my opinion to keep the splash screen up is to put
HTML:
sleep(3);
right after the
HTML:
- (void)applicationDidFinishLaunching:(UIApplication *)application
is called so before the main view is added as a subview to the main window. ei.
HTML:
[window addSubview:[mainViewController view]];
 
If you want to display a dynamic, iAd while loading the app, you'll have to load all your data in the background. Only load what you need for the ad during initial startup, which should only be about a second. Then while you display the ad, and maybe a loading bar or something, in the background you load the rest of the app. When it's loaded, you simply display a "continue" button.
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.