Beispiel #1
0
        public void SendTestSmsWithTwoAttachments()
        {
            IStorageService storageService = new AzureStorageBlobService(_storageConfig);
            TwilioService   twilioService  = new TwilioService(_twilioConfig, storageService);

            var messageSid = twilioService.Send("SendTestSmsWithTwoAttachments test SMS", "+11234567890", _images);

            Assert.IsTrue(!string.IsNullOrEmpty(messageSid));
        }
Beispiel #2
0
        public void SendTestSmsWithOneAttachment()
        {
            IStorageService storageService = new AzureStorageBlobService(_storageConfig);
            TwilioService   twilioService  = new TwilioService(_twilioConfig, storageService);

            var attachment = new Dictionary <string, string>()
            {
                { _images.FirstOrDefault().Key, _images.FirstOrDefault().Value }
            };

            var messageSid = twilioService.Send("SendTestSmsWithNotAttachments test SMS", "+11234567890", attachment);

            Assert.IsTrue(!string.IsNullOrEmpty(messageSid));
        }
Beispiel #3
0
        public static void Main(string[] args)
        {

            var message = new Message(TwilioCredentials.SenderPhoneNumber, "5511954673640", "Hello John Due, you received 5 news messages. Check there!", MessageType.Transactional);
            var result = TwilioService.Send(message);

            if (result.IsValid)
                Console.WriteLine("SMS sent successful!");
            else
            {
                foreach (string error in result.Errors)
                    Console.WriteLine(error);
            }

        }
Beispiel #4
0
        private void OnSendSmsClicked(object sender, EventArgs e)
        {
            string phoneNumber = PhoneNumber.Text;
            string customText  = SmsCustomText.Text;

            Dictionary <string, string> images = new Dictionary <string, string>()
            {
                { "TestImage1.png", @"..\Appx\Assets\Square44x44Logo.scale-200.png" }
            };

            IStorageService storageService = new AzureStorageBlobService(GetStorageConfig());
            TwilioService   twilioService  = new TwilioService(GetTwilioConfig(), storageService);

            var messageSid = twilioService.Send(customText, phoneNumber, images);

            DisplayAlert("Message Result", messageSid, "OK");
        }
        public static void Main(string[] args)
        {
            //var mediaUrl = new[] {
            //    new Uri("http://bibing.us.es/proyectos/abreproy/11833/fichero/2.Capitulo2.pdf")
            //}.ToList();

            var message = new Message(TwilioCredentials.TwilioWhatsSenderPhoneNumber, "5218711313971",
                                      "Hola juanca");
            var result = TwilioService.Send(message);

            if (result.IsValid)
            {
                Console.WriteLine("se envio el mensaje exitosamente!");
            }
            else
            {
                foreach (string error in result.Errors)
                {
                    Console.WriteLine(error);
                }
            }
        }