通过app id启动iOS应用?

时间:2021-04-17 00:25:57

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)

使用iOS 5和back,要从另一个iOS应用程序启动一个iOS应用程序,您需要使用openUrl以及自定义方案/协议。(没有定制方案是不可能推出应用的,如果有两个应用有相同的方案/协议,那么哪个应用会推出就不确定了)

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.

有了iOS 6,就有可能从safari(通过智能应用banner的)和siri中推出一款应用。智能应用横幅将通过应用id启动,但不知道siri是如何启动的。

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?

“应用id启动app”是一个公共/支持的api调用吗?这是否可以用于从另一个自定义应用程序启动一个自定义应用程序?

(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)

(如果是这样,就可以解决启动一个没有支持方案/协议+的现有应用程序的问题,解决两个应用程序同时存在的问题)

1 个解决方案

#1


3  

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/

大卫·史密斯写了一篇关于他们的文章。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):

基本上你只需要将这个metatag添加到webiste页面(其中####### ###是你的应用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:

然后在你的app委托中处理回调url:

-(BOOL)application:(UIApplication*)application
        openURL:(NSURL*)url
        sourceApplication:(NSString*)sourceApplication
        annotation:(id)annotation

#1


3  

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/

大卫·史密斯写了一篇关于他们的文章。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):

基本上你只需要将这个metatag添加到webiste页面(其中####### ###是你的应用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:

然后在你的app委托中处理回调url:

-(BOOL)application:(UIApplication*)application
        openURL:(NSURL*)url
        sourceApplication:(NSString*)sourceApplication
        annotation:(id)annotation