Custom URL Scheme maximum URL length

Shaggy Frog picture Shaggy Frog · Jul 18, 2012 · Viewed 17.3k times · Source

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)?

Answer

nycynik picture nycynik · Jan 3, 2013

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.