UWP use skype to call number

柔情痞子 提交于 2019-12-05 12:51:27

Yes, it's possible and you're right about using Launch the default app for a URI to open Skype from your app.

For the question what Uri can we use, you can refer to Skype development.

Here is the sample code, this will open "Skype" and call the "Echo/Sound Test Service":

private async void OnClick(object sender, RoutedEventArgs e)
{
    var uriSkype = new Uri(@"Skype:echo123?call");

    // Set the option to show a warning
    var promptOptions = new Windows.System.LauncherOptions();
    promptOptions.TreatAsUntrusted = true;

    // Launch the URI
    var success = await Windows.System.Launcher.LaunchUriAsync(uriSkype, promptOptions);

    if (success)
    {
        // URI launched
    }
    else
    {
        // URI launch failed
    }
}

If you want to call number, you can use:

var uriSkype = new Uri(@"Skype:(number)?call");

Or you can also call by the skype id:

var uriSkype = new Uri(@"Skype:(skype id)?call");

This solution works only when Skype is already installed on your PC. If system can not find Skype on your PC, it will open the Store and show the recommended apps which registered this protocol.

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