c# - Calls to Twilio Method is ambiguous -
I am trying to send an SMS using twilio, but when I use the code, Errors are available:
Error 1 Error 11 call is ambiguous between the following methods or properties: 'Twilio.TwilioRestClient.SendMessage (string , String, string, string [], string) 'and' tivialo Twillest client.msms (string, string, string, string [], system. Action) 'C: \ development \ testSMS statement. Espacks C Error 2 Does anyone know how I can fix this? The code is The problem is that overloaded in For example, if you pass an empty string such as the last parameter Then the compiler will know that you want the overload at the end of the Then you will know that you want to call a Finally, I believe that this error to
can not specify a vested-type local variable to zero
// twilio.com/user/account Find your account, Sid and Oth Tokens on String Accountcid = "MySide"; String AuthToken = "Mayutocon"; Var libilio = new twiliorrstclient (accountcid, orthocon); Var message = twilio.SendMessage ("+ 441618504425", "07914164512", "Code is 123456", blank, empty); Console.WriteLine (message.Sid);
SendMessage Is there a
string type in the last parameter and one that
verb & lt; Twilio.Message & gt; takes as it takes. You are going through this code for
null , which is acceptable for both of these types, however, it confuses the compiler because it does not work much that you want to call it.
twilio.SendMessage ("+ 441618504425", "07914164512", "Code is 123456" , Blank, "");
string parameter, not with a
action. & Lt; Twilio.Message & gt; . Alternatively, if you have a blank
action & lt; Twilio.Message & gt; Parameter e.g.
twilio.SendMessage ("+ 441618504425", "07914164512", "Code 123456" passed), tap, (msg) = & gt; {});
action & lt; Twilio.message & gt; takes the parameter and
string not. <
/ code> actually Do not return anything to fix, just change
var message = twilio.SendMessage (...);
twilio.SendMessage (...);
Comments
Post a Comment