phone call in Windows 10 UWP

拈花ヽ惹草 提交于 2019-12-04 14:55:19

I've come with a solution that is working on emulator, I cannot test it on actual device, cause I don't own one.

PhoneCallStore PhoneCallStore = await PhoneCallManager.RequestStoreAsync();
Guid LineGuid = await PhoneCallStore.GetDefaultLineAsync();

PhoneLine = await PhoneLine.FromIdAsync(LineGuid);
PhoneLine.Dial(phoneNumber, nameToBeDisplayed);

You have to add Windows Mobile Extentions for UWP to references of your project as well as declare PhoneCall capability in app manifest.

The line,

PhoneCallManager.ShowPhoneCallUI("0213132131", "my name");

only shows the Call UI. It doesn't make a phone call.

You should use Windows.ApplicationModel.Calls.PhoneLine.Dial to make a phone call. See this for reference https://msdn.microsoft.com/en-us/library/windows.applicationmodel.calls.phoneline.aspx

See this example https://github.com/Microsoft/Windows-universal-samples/blob/master/Samples/PhoneCall/cs/Helpers/CallingInfo.cs#L85

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!