Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launching an iOS app by app id?

Tags:

ios

With iOS 5 and back, to launch one iOS app from another iOS app, you used openUrl along with a custom scheme/protocol. (It was not possible to launch an app without a custom scheme, and if there were two apps with the same scheme/protocol then it was indeterminate about which app would launch)

With iOS 6, it is possible to launch an app from safari (via smart app banner's) and from siri. Smart app banners would launch via app id, unknown how the launch via siri occurs.

Is the "launch an app via app id" a public/supported api call? Could this be used to launch one custom app from another custom app?

(If so, this could solve launching an existing app that does not have a support scheme/protocol + solve the issue of two-app-with-same-scheme issue)

like image 685
jayraynet Avatar asked Aug 15 '12 20:08

jayraynet


1 Answers

The process is called: Smart App Banner.

David Smith wrote a very exhausting post about them. http://david-smith.org/blog/2012/09/20/implementing-smart-app-banners/

Basically you just add this metatag to your webiste page (where ####### is you app id):

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

If you want to pass more paramenters to the call, let say to do something more specific in your app that just open it use:

<meta name="apple-itunes-app" content="app-id=#########, foo=xxxxxx&bar=yyyyyyy"/>

Then in you app delegate handle the callback url:

-(BOOL)application:(UIApplication*)application
        openURL:(NSURL*)url
        sourceApplication:(NSString*)sourceApplication
        annotation:(id)annotation
like image 154
cescofry Avatar answered Nov 01 '22 15:11

cescofry