24

I'm writing a Universal App for Windows 8.1 / Windows Phone 8.1 that at some point displays a list of phone numbers. What I would like to do is allow the user to press one of these numbers and have the device call (or ask permission to call) that number if running on Windows Phone 8.1. I know this was previously possible in Windows Phone 8 by doing the following:

using Microsoft.Phone.Tasks;

PhoneCallTask phoneCallTask = new PhoneCallTask();

phoneCallTask.PhoneNumber = "2065550123";
phoneCallTask.DisplayName = "Gage";

phoneCallTask.Show();

NOTE: This code is wrapped in #if WINDOWS_PHONE_APP

However, when trying to import Microsoft.Phone.Tasks, Visual Studio is unable to find the reference. I know that "ID_CAP_PHONEDIALER" had to be enabled in WMAppManifest.xml in Windows Phone 8, but this doesn't seem to be possible with the universal app model. I've been searching around for a solution but can't find a recent one that includes Windows Phone 8.1 (not Silverlight).

Is there any way to make a phone call from within a universal app? Or is it simply not possible at the moment?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
robmikh
  • 567
  • 1
  • 4
  • 11

1 Answers1

37

In Windows Phone 8.1, We can make phone call by "Windows.ApplicationModel.Calls.PhoneCallManager", just like this:

Windows.ApplicationModel
.Calls.PhoneCallManager
.ShowPhoneCallUI("phone number", "display name");
Ben Pretorius
  • 4,079
  • 4
  • 34
  • 28
Chris Shao
  • 8,231
  • 3
  • 39
  • 37
  • 5
    Thank you! I couldn't find this anywhere! If others are interested, here is the MSDN page on it: http://msdn.microsoft.com/en-us/library/windowsphone/develop/windows.applicationmodel.calls.aspx – robmikh May 09 '14 at 02:35
  • @Chris Is it possible to do something similar in Windows 8.1 using LauncherOptions? – Kinjan Bhavsar Apr 14 '15 at 10:53
  • I think you can't. Because there isn't phone call model in PC or Surface with windows 8.1 OS. @Kinjan Bhavsar – Chris Shao Apr 15 '15 at 01:38
  • Ok But can we user options to select from the apps. Like what Windows 8.1 OS offers us when we download any file and we don't have app to open that then Windows 8.1 offers us with a Popup showing option *Look for an app in store* – Kinjan Bhavsar Apr 15 '15 at 05:44
  • which capability has to be added to use this api. I am also developing universal app but this api is not visible to me. – Rohit Garg Jun 11 '15 at 13:23