iPhone应用程序:我可以通过网站链接打开应用程序吗? [英] iPhone apps: Can I open an app from a link in a website?

查看:110
本文介绍了iPhone应用程序:我可以通过网站链接打开应用程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一名新手iPhone开发人员,编写的应用程序将成为网站的移动版本。

I'm a newbie iPhone developer, writing an app that will kind of be the "mobile version" of a website.

我想知道是否可能从网站链接启动我的应用程序。因此,例如,某人在iPhone Safari中进入我们的网站,点击链接,我们的应用程序即可启动。

I'm wondering whether it's possible to launch my app from a link in a website. So, for example, someone goes into our site in the iPhone Safari, clicks a link, and our app launches.

这可能吗?

如果是这样,我还可以传递参数到我正在启动的应用程序?如... ...
点击不同的链接可以让他们在发布时在应用中获得不同的东西。

Is that possible?
If so can I also "pass parameters" to the app i'm launching? As in...
Clicking different links would allow them to get different stuff in the app at launch time.

谢谢!

Daniel

Thanks!
Daniel

推荐答案

某些应用程序具有将启动它们的URL方案。如果某个应用程序已发布此计划(或者您在其捆绑中挖掘),则可以启动它。例如,假设的Twitter应用程序可能会以twitterapp:// here + is + my + tweet URL启动。如果您使用正确的URL方案预加载您的应用程序,您也可以为您执行此操作。

Certain apps have URL schemes that will launch them. If an app has published this scheme (or if you dig around in their bundle) you can launch it. For example, a hypothetical twitter app might launch with a twitterapp://here+is+my+tweet URL. If you preload your app with the correct URL scheme, you can do this for yours, too.

以下是info.plist中的示例URL方案:

Here's a sample URL scheme from the info.plist:

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLName</key>
        <string>com.standalone.cooltwitterapp</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>twitterapp</string>
        </array>
    </dict>
</array>

这篇关于iPhone应用程序:我可以通过网站链接打开应用程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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