C
C#11mo ago
Florian Voß

❔ ✅ how to open tel: link on Maui?

Process.Start(new ProcessStartInfo("tel:12345"));
Process.Start(new ProcessStartInfo("tel:12345"));
Win32Exception: "An error occurred trying to start process 'tel:12345' with working directory 'C:\\WINDOWS\\system32'. The system cannot find the file specified." when I do same thing in wpf app it works
18 Replies
Denis
Denis11mo ago
Phone dialer - .NET MAUI
Learn how to open the phone dialer to a specific number, in .NET MAUI. The IPhoneDialer interface in the Microsoft.Maui.ApplicationModel.Communication namespace is used to open the phone dialer.
jcotton42
jcotton4211mo ago
$useshellexecute @voflorian99
MODiX
MODiX11mo ago
Process.Start(new ProcessStartInfo("https://www.google.com/") { UseShellExecute = true });
Process.Start(new ProcessStartInfo("https://www.google.com/") { UseShellExecute = true });
jcotton42
jcotton4211mo ago
or the dialer thing I guess
Florian Voß
Florian Voß11mo ago
I have tried that @jcotton42 @Denis https://discord.com/channels/143867839282020352/1140986128816676896 here Gonna try real quick that works 😮 can you explain please why tho? and more importantly, why it doesnt work without UseShellExecute?
jcotton42
jcotton4211mo ago
on Windows UseShellExecute means "ask File Explorer (the shell) to handle opening this" without it, it only works for straight executables, not file/folder paths or protocols not sure how it's interpreted on other platforms
Florian Voß
Florian Voß11mo ago
but how comes i dont need useshellexecute in wpf or console app? it works like a charm I never faced this and used tel links frequently
jcotton42
jcotton4211mo ago
can you show some of that code?
Florian Voß
Florian Voß11mo ago
that I will worry about next ^^ I want it to open teams sure:
public void OnCallClicked(object sender, EventArgs e){
Process.Start(new ProcessStartInfo($"tel:{phoneNumber}"));
}
public void OnCallClicked(object sender, EventArgs e){
Process.Start(new ProcessStartInfo($"tel:{phoneNumber}"));
}
jcotton42
jcotton4211mo ago
... huh interesting
Florian Voß
Florian Voß11mo ago
I litteraly took the code from wpf and copied it over to maui. I dont get why it doesn't work but does with UseSHellExecute in Maui 😄 anyways thx a lot
jcotton42
jcotton4211mo ago
oh wait does the WPF app target Framework?
true if the shell should be used when starting the process; false if the process should be created directly from the executable file. The default is true on .NET Framework apps and false on .NET Core apps.
Florian Voß
Florian Voß11mo ago
yeah it does, FW 4.8 or so or 4.7
jcotton42
jcotton4211mo ago
that would be why
Florian Voß
Florian Voß11mo ago
ohhh thank you so much about to close thread any idea on this tho @jcotton42 ? why dial doesnt work
jcotton42
jcotton4211mo ago
dunno, don't use MAUI
Florian Voß
Florian Voß11mo ago
okay 🙂 anyway I wanna use Microsoft Teams, not dial so not too important
Accord
Accord11mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.