简体   繁体   中英

Make a phone call in Windows 8.1

To make a phone call in Windows Phone 8.1 I have to do the following:

Windows.ApplicationModel.Calls.ShowPhoneCallUI(number, name);

But in Windows 8.1 app there is no class PhoneCallManager in Windows.ApplicationModel.Calls namespace. Is there any way to make a phone call in Windows 8.1 store app?

Thanks in advance!

I've just googled for you and found that link.

http://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.calls.phonecallmanager.aspx

Always try to stay on the newest stand in your programming network. I also found that:

Windows Phone 8.1 [Windows Runtime apps only]

is compatible to run

public static void ShowPhoneCallUI( string phoneNumber, string displayName )

I think that microsoft is still updating their classes to 8.1 but you would be able to use already some namespaces.

On Windows Phone (!) you can either use

var phoneCallTask = new PhoneCallTask 
{ 
    PhoneNumber = number,
    DisplayName = "The Name goes here" 
};

phoneCallTask.Show();

or

Windows.ApplicationModel.Calls.PhoneCallManager.ShowPhoneCallUI(number, "The Name goes here");

Maybe you are simply missing an assembly reference?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM