UWP URI for making a call

烈酒焚心 提交于 2021-01-04 07:38:10

问题


I'm working on a UWP app that uses a RichTextBlock to display some text that the user can enter, I want it to Identify phone numbers so that I can tap the number and then the application should take me to the call app or people app and give me the option to call this number. I search for a solution for that and what I found so far is in this link: https://msdn.microsoft.com/en-us/windows/uwp/launch-resume/launch-default-app

I couldn't find the URI that I can use to make it work, the best thing that I've achieved so far is by using a hyperlink that contains the following:

 if(isPhoneNumber)
       hyper = @"ms-people:savetocontact?PhoneNumber="+hyper+"&Email=&ContactName=";

but now when I tap the number the people app is launched on the contacts list screen.

Any advice would be great, thanks.


回答1:


Try tel:<phone-number> uri scheme. You will get the below page where you can send text message, call or save this number. Eg.:

await Launcher.LaunchUriAsync(new Uri("tel:+36301234567"));



来源:https://stackoverflow.com/questions/39017583/uwp-uri-for-making-a-call

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