Smart App Banners

I hate those annoying “Do you want to download our app?” splash pages that cover a web site when I’m in mobile safari. Instead, I’d suggest using the new iOS6 Smart App Banners which are a much nicer solution that’s almost too easy.

All you have to do is add a meta tag to the <head> portion of your web site:

<meta name="apple-itunes-app" content="app-id=YOUR_APP_ID"/>

where ‘YOUR_APP_ID’ is your app’s id number (which you can find in iTunes Connect).

Now you have a nice banner across the top of mobile safari that will display your app along with some basic info and a prompt to download or purchase it (or open it if the app is already installed).

If you also have an affiliate code you can include your partnerID and siteId using ‘affiliate-data’:

<meta name="apple-itunes-app" content="app-id=YOUR_APP_ID, affiliate-data=siteID=YOUR_SITE_ID&partnerId=YOUR_PARTNER_ID"/>

One last option you really should take advantage of is the app-argument. This is a URL such as http://whatever/you/like and is passed directly to your app’s delegate (even if you don’t have any custom URL handler registered). This lets you pass information to your app when it launches so you can easily know it came from a particular Smart App Banner. This can help track where links are coming from or, better yet, you can use it to display a particular screen relevant to the page the banner is displayed on (such as a specific level or article).

<meta name="apple-itunes-app" content="app-id=YOUR_APP_ID, app-argument=http://article/1"/>

Your app’s UIApplication delegate will receive the app-argument as the openURL value:

-(BOOL)application:(UIApplication*)app openURL:(NSURL*)url 
    sourceApplication:(NSString*)sApp annotation:(id)ann {
    
    if (url != nil) {
        // Parse url and alter your launch state as appropriate.
    }
    return YES;
}

Now go and get rid of those stupid splashes. Please!

The post ‘Smart App Banners’ was first published by Jeffrey Sambells on