问题
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