0
votes

I'm programming in Xamarin.Forms (PCL), and I have seen many post but none one works for me. I'm using the plugin PhoneCall.Forms.Plugin I made a method to call with a button that contains the next code

try
{
    var PhoneCallTask = CrossMessaging.Current.PhoneDialer;
    if (PhoneCallTask.CanMakePhoneCall)
    {
        PhoneCallTask.MakePhoneCall("+528331607211", "Laura");
    }
    else
    {
        DisplayAlert("Llamada", "No se puede hacer llamada", "Ok");
    }
}

It throws an error:

System.NotlmplementedException: This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation.

Deploy stops

3
you have to install the package in your application (iOS/android) projects along with the PCL project. - SushiHangover
The same package is installed in both projects - Luis David De La Cruz Bautista
Can you add a link to the plugin you're using? - cvanbeek

3 Answers

0
votes

Have you tried the Messaging plugin? Like said by Jason here.

0
votes

Try:

Device.OpenUri(new Uri("tel:528331607211"));

0
votes

If you are using this plugin (I'm not sure if this is the specific one you're using or not), then you need to make the phone call using a Dependency service (This is explained in the plugin readme).

Make a method in your PCL project to call the dependancy service:

private void QCall(string number)
{
    var notificator = DependencyService.Get<IPhoneCall>();
    notificator.MakeQuickCall (number);
}

In each platform specific project, initialize the plugin. For Android, this will be done in the OnCreate method of your MainActivity, and for iOS in AppDelegate in the FinishedLaunching method. Add the following line to each after the initialization of Xamarin.Forms:

PhoneCallImplementation.Init();

Then when you call QCall() in your PCL project it will run the code necessary for the specific platform the user is on.