Search Unity

[How-to?] Custom protocol / URL scheme to open game from browser

Discussion in 'Windows' started by binoculars88, Apr 30, 2019.

  1. binoculars88

    binoculars88

    Joined:
    Aug 9, 2017
    Posts:
    80
    Hi all!

    I'm getting on unfamiliar terrain here for me, but here I go anyway :) .

    My desired end goal: being able to open my game from a browser via a custom protocol, for example mygame://blablabla . Actually very similar to how Unity opens unityhub from the browser.

    Been reading about windows registry etc. (which I don't know much about), but all my users have to be able to do this of course, so I read somewhere that I need an install wizard probably that registers this protocol and then Windows will know to open my game.

    That's about all I could find and understand... but how to proceed now?

    Can I do this from within Unity? Or do I need to export it the usual way and use a install wizard creator thing? How would that work? Any recommendations which one to use and how?

    Any help is much appreciated!
     
    salgue likes this.
  2. timke

    timke

    Unity Technologies

    Joined:
    Nov 30, 2017
    Posts:
    51
    Unity doesn't provide any kind of installer or publishing mechanism at this time. So you'll have to figure out the best way to distribute your game, which depends on which OS or platform you're developing for: Windows, iOS, Xbox, etc. They all have different packaging and installation requirements.

    Have you considered building your game for WebGL? Since you goal is run the game from the browser this is one possible solution. Although WebGL has restrictions/complications compared to native desktop builds.
     
  3. salgue

    salgue

    Joined:
    Jul 26, 2017
    Posts:
    2
    Hello timke, suppose we manage to register a custom protocol to launch our app, how can we query the data sent to it? we want to do something like in the following post but within a Unity app, how can we achieve the same?
    https://stackoverflow.com/a/38205984/877225

    Any help is much appreciated!

    - Sal
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,254
    salgue likes this.
  5. binoculars88

    binoculars88

    Joined:
    Aug 9, 2017
    Posts:
    80
    Any chance you would like to share how you accomplished this?