1
votes

My project requires me to directly make a call from an app. There's an image which should automatically dial the number on the onclick event. Is there a solution to my problem?

2

2 Answers

2
votes

You can open the dialer using this:

Device.OpenUri (new Uri ("tel://xxxxxxxxxx"));

However, the user has to actually hit a button to initiate a call.

1
votes

Just we can do it like, on Call Button clicked,

private void CallBtnClicked(object sender, EventArgs e)
{
    Launcher.OpenAsync(new Uri("tel:XXXXXXXXXX"));
}

Note: Launcher is imported from Xamarin.Essentials and XXXXXXXXXX is the Phone Number.