我可以从iPhone上的其他应用程序启动一个应用程序 [英] Can I launch one app from other app on iPhone
问题描述
我想要创建必须启动另一个应用并在最后运行一些功能的应用。
我的意思是我的应用A呼叫应用B并在B中运行一些方法。
我可以这样做吗?
我知道我想使用URL方案,但是我可以运行吗?另一个应用中的某种方法?
谢谢!
是的你可以使用自定义URL方案实现此目的。参见与其他应用程序通信。
应用程序B需要注册一个自定义URL方案,App A用它来启动B并传递命令。 / p>
以下代码片段说明了一个应用程序如何请求其他应用程序的服务。此示例中的todolist是App B注册的假设自定义方案。
NSURL * myURL = [NSURL URLWithString:@ ?todolist的://www.acme.com季度%20Report#200806231300\" ];
[[UIApplication sharedApplication] openURL:myURL];
I want to create app which have to launch another app and run some features in last.
I mean my app A call app B and run in B some method.
Can I do this?
I know that I want to use URL scheme, but can I run some method in another app?
Thanks!
Yes you can achieve this using custom URL Schemes. See Communicating with Other Apps.
App B will need to register a custom URL Scheme which App A uses to launch B and pass it commands.
The following code fragment illustrates how one app can request the services of another app. "todolist" in this example is a hypothetical custom scheme registered by App B.
NSURL *myURL = [NSURL URLWithString:@"todolist://www.acme.com?Quarterly%20Report#200806231300"];
[[UIApplication sharedApplication] openURL:myURL];
这篇关于我可以从iPhone上的其他应用程序启动一个应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!