- Home /
Dial Phone Number from Unity
Hello,
I was just wondering if anyone knows a way to get an iPhone to make a call from a unity app?
I've had a look through the reference, and forums, and it seems to me that it can't be done... an i wrong?
i hope i'm wrong.
Answer by Peter G · Nov 08, 2011 at 03:16 AM
You should definitely be able to do it. It's a really easy 2 lines of code:
[[UIApplication sharedApplication]
openURL:[NSURL URLWithString:@"tel://18004664411"]];
This goes in your native code plugin and that shouldn't be that hard to set up. Check the docs on how to do that.
Hey mate, so I've been looking through the docs and I think I know what's going on. I need to make a c script with just that code in it and put I in my classes folder, then call it within java right?
That's the general idea yes. You need to write an Objective-C++ (.mm) script and put it in your classes folder. Then link it to your project using C#. Then you can call these C# function from js if you want.
Your answer
Follow this Question
Related Questions
Unity iPhone 2D Left Right movement 0 Answers
About iPhone/iPad development 1 Answer
Exporting my Mac game to........ 2 Answers