未检测到 iOS 应用 URL [英] iOS App URL is not being detected

查看:29
本文介绍了未检测到 iOS 应用 URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我的 iOS 应用创建了一个自定义应用 URL.URL格式类似于:

I have created a custom App URL for my iOS app. The URL format is similar to this:

myappname://texttobeparsed

当我在 safari 中粘贴 URL 时,这工作正常,我的应用程序打开并正确处理 URL.问题在于 iMessage 或 Notes 等其他应用无法将其识别为 URL.

This works fine when I paste the URL in safari, My App opens and correctly handles the URL. The problem is that other apps such as iMessage or Notes do not recognize this as a URL.

为什么此 URL 方案不被识别为 URL?是否与我在 info.plist 文件或其他文件中的设置方式有关?

Why isn't this URL scheme being recognized as a URL? Could it have to do with how I set it up in my info.plist file or something else?

或者,URL 是否需要采用不同的格式才能被识别?

Or, does the URL need to be in a different format to be recognized?

我知道可以让系统将其识别为除网络浏览器以外的其他应用程序中的 URL,因为我之前在其他应用程序中见过它(例如 iTunes:itms://itunes.com/apps/appname 或 Twitter:twitter:// 或 Facebook:fb://).

I know it's possible to have the system recognize it as a URL in apps other than web-browsers because I've seen it before with other apps (ex. iTunes: itms://itunes.com/apps/appname or Twitter: twitter:// or Facebook: fb://).

推荐答案

对此您无能为力.如果链接不明确(例如在 HTML 电子邮件中),这些应用程序只能识别一组内置的标准 URL 方案.itms:// 是 Apple 自己的方案之一(用于 iTunes Store),因此除了标准的 mailto://http://, tel://... 方案.

There's nothing you can do about this. If the link isn't explicit (e.g. in an HTML email), these apps can just recognize a built-in set of standard URL schemes. itms:// is one of Apple's own schemes (for the iTunes Store), so it makes sense that it is supported in addition to the standard mailto://, http://, tel://... schemes.

我猜想用于确定文本视图等中的有效 URL 的信息以某种方式缓存.与我最初的猜测相反,似乎特定于应用程序的 URL 确实 在 Notes 等中工作.例如,我已经用 tweetbot:// 对此进行了测试(我已经安装)和 twitter://(我没有安装)来验证它不只是检查像 *:// 这样的模式,但是实际使用有关已安装应用的信息.

I would guess that the information that is used to determine what constitutes a valid URL in text views etc. is cached somehow. Contrary to what I initially guessed, it seems that app-specific URLs do work in Notes, etc. I've tested this with tweetbot:// for example (which I have installed) and twitter:// (which I don't have installed) to verify that it doesn't just check for a pattern like *://, but actually uses information about the installed apps.

我建议您尝试重新启动设备.如果这是某些缓存的问题,那可能会有所帮助,而且如果您的 URL 方案已经在 Safari 中有效,我认为您无能为力.

I'd suggest that you try to restart your device. If it's an issue with some cache, that might help and I don't think there's much else you could do if your URL scheme already works in Safari.

更新:我已经安装了官方 Twitter 应用程序来测试这个,twitter:// 方案没有立即在 Notes 中识别,但在杀死并重新启动后Notes 应用,它奏效了.

Update: I've installed the official Twitter app to test this, the twitter:// scheme wasn't immediately recognized in Notes, but after killing and restarting the Notes app, it worked.

更新 2:我使用 myappname:// 作为自定义 URL 方案完成了一个最小的测试应用程序.同样,与 Twitter 应用程序一样,它在重新启动 Notes 应用程序后工作,因此它似乎与应用程序的受欢迎程度或是否已提交无关.

Update 2: I've done a minimal test app with myappname:// as a custom URL scheme. Again, like with the Twitter app, it worked after restarting the Notes app, so it doesn't seem related to the popularity of the app or whether it's been submitted or not.

这篇关于未检测到 iOS 应用 URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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