How Application.OpenURL Works?? Need Help Pls

Hey,

I always look at the scripting reference for these but cannot figure out how this one works. It does make sense when we write the following to open a website,

Application.OpenURL ("http://unity3d.com/");

But i cannot understand how this code does send an email or open sms composer.I’ve the scripts for those but i want to understand it.There is no documentation based on this as well so where to look at?? Where? When we type strings into Application.OpenURL()it openes sms composer we can send email but i really want to know and see a documentation about it.Would anyone help me pls?

I should imagine, although I haven’t extensively verified it, that this will pass off to whatever part of the system deals with opening URLs. On PC / Mac, opening an http:// URL will usually open it in the default web browser. Opening a mailto: URL will open the default mail client, etc. This is easily verified in the editor. On PC at least, it’ll do the exact same thing that opening up the Run… dialog from the start menu does when you enter the exact same URL.

iOS and Android have similar functionality, you pass the system an arbitrary URL, and it will use its built-in rules to open it in the best application it can. On iOS at least I’m sure it passes off to UIApplication.openURL, in Android it’ll probably do something like this using Intents.

You specify that an SMS composer is opened, but you don’t say what device you’re doing it on. I’d say that either you’ve given it a URL that it thinks needs to be opened in the SMS composer, or you’ve set up your test device (intentionally or not) to open URLs in the SMS app.

Regardless, what application opens your URL isn’t up to you - it’s up to your device / platform. You’re asking the system to open the URL as best it knows how, and leaving the decision to the operating system.