public ContactViewModel(Contact contact)
 {
     Contact = contact;
     Number = contact.Number;
     Name = contact.Name;
     PhotoId = contact.PhotoId;
     Email = contact.Email;
 }
 public void Send(Contact contact)
 {
     //if (!string.IsNullOrEmpty(contact.Email))
     //{
     //    var email = new Intent(Intent.ActionSend);
     //    email.PutExtra(Intent.ExtraEmail, new[] { contact.Email });
     //    email.PutExtra(Intent.ExtraSubject, "Hey, join me in CrossChat!");
     //    email.PutExtra(Intent.ExtraText, "Check this out: https://github.com/EgorBo/CrossChat-Xamarin.Forms");
     //    email.SetType("message/rfc822");
     //    Forms.Context.StartActivity(email);
     //}
     SmsManager.Default.SendTextMessage(contact.Number, null, "Check this out: https://github.com/EgorBo/CrossChat-Xamarin.Forms", null, null);
 }
        public void Send(Contact contact)
        {
            if (!string.IsNullOrEmpty(contact.Email))
            {
                var emailComposeTask = new EmailComposeTask();

                emailComposeTask.Subject = "Hey, join me in CrossChat!";
                emailComposeTask.Body = "Check this out: https://github.com/EgorBo/CrossChat-Xamarin.Forms";
                emailComposeTask.To = contact.Email;

                emailComposeTask.Show();
            }
            else
            {
                var emailComposeTask = new SmsComposeTask();

                emailComposeTask.Body = "Check this out: https://github.com/EgorBo/CrossChat-Xamarin.Forms";
                emailComposeTask.To = contact.Number;

                emailComposeTask.Show();
            }
        }
 public void Send(Contact contact)
 {
     var smsTo = NSUrl.FromString("sms:" + contact.Number);
     UIApplication.SharedApplication.OpenUrl(smsTo);
 }