Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by aaronflippo · May 10, 2013 at 10:28 PM · macosxurlcommand line

Parse URL passed parameters on Standalone Mac build

I'm trying to make it so players can launch our Unity game from a URL, and to capture the parameters passed. I've gotten as far as registering a URL-scheme handler by editing the info.plist, and that works - the app can launch via a URL in a browser. However, I'm having trouble retrieving the parameters.

I was hoping these would translate to command-line arguments( which Unity can read) - but it doesn't.

It seems that the way to do this on Mac is to register a hook in native code for when the application finishes launching - for instance like this:

http://stackoverflow.com/questions/6561661/url-scheme-qt-and-mac

However, my attempt to do this through a native mac plugins doesn't seem to work - presumably because the event triggered happens before my plugin is loaded.

Does anyone know how to do this? One potential solution I've been considering is to use a separate application to receive the URL, which would then launch my game.

Barring a more elegant solution, could anyone suggest a clean way to do that? Perhaps I could put two executables in the same package and have one trigger the other?

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image trieb-raum · Feb 20, 2016 at 10:22 PM 0
Share

Have you found a nice solution to this issue? Is there a proper way now to achieve launching by url-scheme in Unity 5 now?

avatar image ThiagoSCF · Mar 29, 2017 at 03:56 PM 0
Share

Same here. Did anyone figure this out?

avatar image fcloss · Jun 30, 2017 at 03:48 PM 0
Share

HI guys, any solution found? I would need custom url and file association!

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by aaronflippo · Jun 30, 2017 at 03:59 PM

I never found a good easy solution. Basically, we made it so when you clicked a button on the webpage, it recorded some info on a server, and triggered the game to launch. Then the game looked for the existence of that chunk of data that was associated with the user's account. It wasn't very elegant.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image fcloss · Jun 30, 2017 at 04:21 PM 0
Share

That's sad that Unity hasn't made Delegates available. I saw a hacking for overriding them, but a commercial app should not be a bunch of hacking. If unity dev just made association and custom url accessible, it would solve 99% of the devs requests.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

16 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

[OSX] Cannot tab out using Cmd+Tab - Solution? 0 Answers

Can't run unity 2.6.1 on mac os x 10.6.3 2 Answers

Minimize MacOSX fullscreen and open URL 1 Answer

Unity fails to include .bundle for native code plugin when building Intel Mac player. 0 Answers

Xamarin, MonoDevelop 4 or current unity mono? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges