Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do custom link prefixes work? (like steam://)

I was really curious about how custom link prefixes work (I really have no clue what they are called), and I couldn't find anything online about it. None.

If anybody knows how this works, and/or could point me in the direction of a tutorial, that would me amazing.

EDIT: I did find a tutorial on doing this in iOS, but I need this for a PC/Windows app.

like image 688
mincrmatt12 Avatar asked Dec 05 '14 23:12

mincrmatt12


1 Answers

These prefixes are called URI Schemes and are introduced to allow referencing things across applications. Thus, these prefixes are the first part of a Uniform Resource Identifier.

Big companies as Valve in the case of steam seem to use URI Schemes quite excessively, without really following RFC 4395. If you plan to use such a scheme, I highly encourage you to read it, at least Section 2.8. This will make sure that your scheme does not collide with other well-behaved applications. If in doubt, ask on their mailing list.

For the technical implementation, how to implement support for a URI Scheme is heavily application-dependent. Steam, for instance, uses its schema through OS-level handlers for things like starting games or controlling the steam client through the browser. Its URIs thus somehow reference the locally installed steam client. http, as a different example, is used to reference content on a specific host. While steam is used using OS-level features and a local client, http is usually completely handled by the browser. A third example are tel URIs, which reference telephone numbers and are not directly mapped to a specific application, but also usually not handled by the browser. Thus, you should look into the documentation of the client application that should understand your URIs, and search for the APIs required to implement your functionality.


If you are interested in handling your URI scheme within a local application on Windows, there's a question covering that already.

like image 184
dst Avatar answered Sep 30 '22 19:09

dst