I want my c# UWP App to support calling numbers.
When I'm on W10 mobile I want it to use W10 PhoneCall API normal (this is working)
Windows.ApplicationModel.Calls.PhoneCallManager.ShowPhoneCallUI(number, name);
but on W10 Desktop/PC I won't have a GSM provider, so I thought, maybe use skype to call the number, the user pressed.
Is that possible via UWP? Maybe similar like opening websites:
await Windows.System.Launcher.LaunchUriAsync(new Uri(website));
Calling Skype contacts on Skype is always free - but to call a mobile phone or landline through Skype requires Skype Credit or a subscription.
Call Anyone Around the WorldYou can call landlines and mobile devices from anywhere in the world at great low rates using Skype Credit. Save even more if you call specific destinations using Skype subscriptions.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With