Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom URL Scheme maximum URL length

Tags:

ios

custom-url

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

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

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

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

like image 491
Shaggy Frog Avatar asked Jul 18 '12 16:07

Shaggy Frog


People also ask

Is there a max length for a URL?

The official documentation specifies a maximum length of 2048 characters for the <loc> element, which is used to submit URLs: URL of the page. This URL must begin with the protocol (e.g. “http”) and end with a trailing slash if required by the web server. This value must not exceed 2,048 characters.

What is the maximum characters allowed in the custom URL?

Microsoft Support says "Maximum URL length is 2,083 characters in Internet Explorer".

What is the max length of API URL?

URL length The REST API supports Uniform Resource Locators (URLs) with a length of up to 6000 characters. To avoid exceeding this limit, it is important to be aware of URL encoding.

How long can URL params be?

Microsoft states that the maximum length of a URL in Internet Explorer is 2,083 characters, with no more than 2,048 characters in the path portion of the URL.


1 Answers

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

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.

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.

like image 84
nycynik Avatar answered Sep 25 '22 06:09

nycynik