自定义URL方案最大URL长度 [英] Custom URL Scheme maximum URL length

查看:119
本文介绍了自定义URL方案最大URL长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据标题,当使用带有应用程序的自定义URL方案时,URL的最大长度是多少?

As per title, what is the maximum length a URL can be, when using a custom URL scheme with an app?

例如。如果我通过URL启动另一个应用程序,并使用诸如

e.g. If I'm launching another app via URL, and passing a blob of data using something like

myappscheme:// some / path?data = 0123456789ABCDEF

   myappscheme://some/path?data=0123456789ABCDEF

在URL被切断之前该字符串可以获得多长时间(或者系统拒绝启动其他应用程序)?

how long can that string get before the URL gets cut off (or the system refuses to launch the other app at all)?

推荐答案

不幸的是,答案似乎没有。我可以找到的任何iOS文档中都没有具体定义max len。

Unfortunately, the answer does not seem to be available. The max len is not defined specifically in any iOS documentation that I could find.

如上所述,MSK的链接有限制URL基本网址长度,而不是网址的绝对字符串长度。所以这可能是最大的安全赌注,大约2000个字符。

There are limits, as noted above by MSK's link, for the URL base url length, not the absolute string length of the url. So thats probably a safe bet for a max, around 2000 characters.

然而,在测试中似乎没有上限。我能够在iOS上使用365,535个字符网址,没有任何问题。但是没有要求苹果继续支持它,所以这是使用你自己的风险。然而,我会说,基于这样一个事实,许多应用程序正在使用它来传输信息,包括应用程序之间的大量数据,Apple可能会继续支持它,因为似乎没有理由减少长度。

However, in testing there seemed to be no upper limit. I was able to use 365,535 character URLs on iOS with no problems. But there is no requirement for apple to continue to support it, so it's a "use at your own risk". I would however, say that based on the fact that many, many apps are using this to transfer information, including large amounts of data between apps, that Apple will probably continue to support it, since there seems to be no reason to reduce the length.

这篇关于自定义URL方案最大URL长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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