Skip to content

Instantly share code, notes, and snippets.

@icebeam7
Created October 15, 2018 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icebeam7/da8a27e057953cdd592a97cf9db4b3a5 to your computer and use it in GitHub Desktop.
Save icebeam7/da8a27e057953cdd592a97cf9db4b3a5 to your computer and use it in GitHub Desktop.
XamarinWhatsApp: ServicioWhatsAppTwilio.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using XamarinWhatsApp.Helpers;
using XamarinWhatsApp.Modelos;
using Twilio;
using Twilio.Types;
using Twilio.Rest.Api.V2010.Account;
namespace XamarinWhatsApp.Servicios
{
public static class ServicioWhatsAppTwilio
{
public static MessageResource EnviarMensaje(Mensaje mensaje)
{
var whatsapp = MessageResource.Create(
body: mensaje.Body,
from: new PhoneNumber($"whatsapp:{mensaje.From}"),
to: new PhoneNumber($"whatsapp:{mensaje.To}")
);
return whatsapp;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment