是否可以使用Swift在iOS 8中启动另一个应用程序? [英] Is it possible to launch another app in iOS 8 using Swift?

查看:73
本文介绍了是否可以使用Swift在iOS 8中启动另一个应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从另一个应用程序中启动任何应用程序?

Is it possible to launch any app from within another app?

例如,在我的应用程序中,我希望用户按下按钮并启动另一个应用程序(不要关闭当前的应用程序,只需打开另一个应用程序并切换到它。)

For example, in my application, I want the user to push a button and launch another app (don't close the current app, just open another app and switch to it).

如何使用Swift在iOS 8中执行此操作?

How can I do it in iOS 8 using Swift?

推荐答案

唯一的方法是使用深链接,应用的开发者必须创建。

The only way to do this is to use a deep link, which the developer of an app must have created.

iOS SDK不允许您的应用与其他应用互动,除非它使用新的< iOS 8引入了一个href =https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/ExtensibilityPG/index.html>扩展框架但是,此扩展只允许你可以在另一个应用程序中提供自己应用程序的内容和功能:你不能强制打开另一个应用程序。

The iOS SDK does not allow your app to interact with other apps unless it uses the new Extensions framework introduced with iOS 8. However, this extension only allows you to provide content and capabilities of your own app within another: you cannot force another app to open.

你所描述的只有深层链接才能实现这是相当不常见的,必须由您尝试打开的应用程序的开发人员定义。

What you've described is only possible with deep links that are fairly uncommon and must be defined by the developer of the app you are trying to open.

因此,例如,您的应用程序中的链接可以打开Pocket应用程序,这允许您保存文章供以后阅读,使用 pocket:// 链接(而不是 http:// https:// ),同样地,可以使用 pebble:// 打开Pebble Smartwatch应用程序链接。但是,这些是由这些应用程序的开发人员定义的链接,并且此技术不适用于所有应用程序。

So, for example, a link in your app could open the Pocket application, which allows you to save articles for later reading, with a pocket:// link (as opposed to http:// or https://) and, similarly, the Pebble Smartwatch application can be opened with a pebble:// link. However, these are links that are defined by the developers of those applications and this technique does not apply to all apps.

这篇关于是否可以使用Swift在iOS 8中启动另一个应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆