Button to make Phone Call

Hi all,

Here I am struggling to incorporate the native IOS CALL function into unity. All I want is just to tab on a button and it make a phone call. I’ve heard about the plugins but I am not sure on how to build the plugins. Any help is much appreciated. T.Q.

Best regards,
Victor Yew

just import the plugins (usually a unitypackage) and build. that’s how it works mostly.

Thank you for your reply, synapsemassage.

I know that’s usually the case, but according to this page http://unity3d.com/support/documentation/Manual/Plugins.html it means more than that to me. I’ve searched all over the internet hoping to find one plugin which incorporates the function i mentioned above but with no luck. Perhaps, someone can actually guide me on how to build a native plugin from xcode.

Did you take a look at the free NativeToolkit Plugin in the asset store?

yeah yeah I just found out just now. It does mentioned something I am looking for. I am about to try out. Thank you for the hints anyway.

Application.OpenURL( “tel://5555551212” ) should work as well if I am not mistaken.

4 Likes

Whoa. I am going to test this out. Who should I have people call… :slight_smile:

Wow, that’s interesting! If that works, then we don’t really need a plugin to call out. cool.

Cooool!

Btw thank you prime31 for doing a great job there to develop those plugins!

@Victor, many thanks! We were put here on earth to make sure all the Unity devs can focus on their games and not on all the other silly stuff!

I found this a useful little tutorial on where to start with native plugins in OSX. Hopefully it’ll give you some help with your calling issue:

http://www.reigndesign.com/blog/unity-native-plugins-os-x/

could someone please elaborate more, I don’t script.i need to make a call via a button but where would i put that piece of code and what else does it need
thank you
also if someone could point me in the direction of a plugin that would be cool

If you don’t code, you’re gonna have a bad time.

2 Likes

Works great! Didn’t realize the phone worked off a URI scheme. Very handy.

Hi , I was trying to do the same thing and make a call from a button in unity . I used Application.OpenURL(“tel://myNumber”) and it works fine . but what I need to do is to use symbols like # and * in the number string and if I use these symbols the rest of the string after these characters won’t be send to tel app . I’ll appreciate if someone can help me with this .
thanks so much

just found my answer :slight_smile: : initiate a phone call on android with special character # - Stack Overflow
Is this possible to directly call the number without having to click the dial button in the tell app?
thanks

This is pretty wicked! In the stand alone player on my mac it opens up the Skyp ap, it did not dial my phone number on my mac though??? Not sure why??
But anyways this opens ideas :slight_smile:
Is it possible to make a dial screen in unity with GUI Texture buttons so you could dial a number in Unity and then have that number dial out?
It seems like it could be done but not sure how that would be coded to work with GUI Texture buttons or a dialler ?

Could this type of command be used for other situations such as opening the default Map app?

1 Like

thanks for @prime31 for your command, perfect job very very thanks :slight_smile: (y)