views:

721

answers:

3

So I just made my web-application "iPhone Friendly". So you can add it to your home screen and it has an icon, no chroming, etc etc.

The problem is that I want to display a custom splash-screen every time it is opened from the iPhone home screen. Right now it just shows the last screen viewed while it basically runs a refresh.

I have tried attaching events to window.onfocus, window.onblur, window.onbeforeunload, and NONE of them seem to work right when the app is being run in "mobile-app" mode.

Am I being dumb? Er.... don't answer that. Does anyone know what is wrong?

+3  A: 

Unfortunately, with the restrictions Apple imposes, this is impossible.
My recommendation is to create a App Store application with a full-screen WebView. Then, you can use a default.png file and a ImageView for your splash screen. Also, you get a ton more visibility on the App Store. (Also, if you go this route, check out PhoneGap - http://phonegap.com/).

Isaac Waller
+2  A: 

The loading screen you are talking about is the loading screen for an APPLICATION, not a webpage, i.e its the loading screen for Safari. This has nothing to do with "the restrictions Apple imposes", just with the fact that because your web app still runs in the browser, the browser needs to load first. Like was also said, if you want to get around this you need to build your own app, in which you can specify the splash screen.

micmcg
+3  A: 

Update!! In the iPhone 3.0 update, mobile safari now supports the ability to specify an image to be used on startup:

Remember this only works with iPhones that are running 3.0+

Drekar