用于拨打电话的 UWP URI [英] UWP URI for making a call

查看:45
本文介绍了用于拨打电话的 UWP URI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个 UWP 应用程序,它使用 RichTextBlock 显示一些用户可以输入的文本,我希望它识别电话号码以便我可以点击号码,然后应用程序应该将我带到呼叫应用程序或人们的应用程序,并让我选择拨打这个号码.我为此寻找解决方案,到目前为止我发现的是这个链接:

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.

解决方案

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"));

这篇关于用于拨打电话的 UWP URI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆