Calling a number inside app

BonnBonn USMember ✭✭

Hi!

I would like to know how to call a number from app. I tried to look for it over the net but I can't find one for c#.

thanks

Posts

  • nodoidnodoid GBMember, Beta ✭✭✭

    This works fine for me…

    using System;
    using MonoTouch.Foundation;
    using MonoTouch.UIKit;
    
    namespace pfjtest
    {
        public static class EmergencyCall
        {
            public static void callNumber()
            {
                string phoneNumber = "939-555-0113";
                string phoneURLString = string.Format("tel:{0}", phoneNumber);
                NSUrl phoneURL = new NSUrl(phoneURLString);
                UIApplication.SharedApplication.OpenUrl(phoneURL);
            }
        }
    }
    

    OK, this is overly long as it's from much larger app, but simply done

    var url = NSUrl.FromString("tel:939-555-0113");
    UIApplication.SharedApplication.OpenUrl(url);
    

    will do the job :)

    Paul

  • DanMiserDanMiser USMember ✭✭

    telprompt: is another nice one that provides the Call/Cancel dialog functionality to you for free, too.

  • BonnBonn USMember ✭✭

    thank you for your response! :D

Sign In or Register to comment.