Exemple #1
0
 public static void SendSampleMultipleSms(this ISmsTask smsTask)
 {
     if (smsTask.CanSendSms)
     {
         smsTask.SendSms("+27219330000;+27219330001", "Well hello there from Xam.Messaging.Plugin");
     }
 }
        private void ClickPhone(Phone phone)
        {
            if (phone == null)
            {
                return;
            }

            ActionSheetConfig config = new ActionSheetConfig();

            config.Add(ResourceService.GetString("callAction"), () =>
            {
                IPhoneCallTask phoneDialer = CrossMessaging.Current.PhoneDialer;
                if (!phoneDialer.CanMakePhoneCall)
                {
                    UserDialogs.Instance.Alert(ResourceService.GetString("cannotCall"));
                    return;
                }
                phoneDialer.MakePhoneCall(phone.Number);
            });
            config.Add(ResourceService.GetString("messageAction"), () =>
            {
                ISmsTask smsMessenger = CrossMessaging.Current.SmsMessenger;
                if (!smsMessenger.CanSendSms)
                {
                    UserDialogs.Instance.Alert(ResourceService.GetString("cannotSms"));
                    return;
                }
                smsMessenger.SendSms(phone.Number);
            });
            config.Add(ResourceService.GetString("cancelAction"));
            UserDialogs.Instance.ActionSheet(config);
        }
 public static void SendSampleSms(this ISmsTask smsTask)
 {
     if (smsTask.CanSendSms)
     {
         smsTask.SendSms("+27213894839493", "Well hello there from Xam.Messaging.Plugin");
     }
 }
 public static void SendSampleSms(this ISmsTask smsTask)
 {
     if (smsTask.CanSendSms)
     {
         smsTask.SendSms("+27219330000", "Well hello there from Xam.Messaging.Plugin.  Some special characters. ÇÇẪ");
     }
 }
Exemple #5
0
        private void ClickPhone(Phone phone)
        {
            if (phone == null)
            {
                return;
            }

            ActionSheetConfig config = new ActionSheetConfig();

            config.Add(ResourceService.GetString("callAction"), () =>
            {
                IPhoneCallTask phoneDialer = CrossMessaging.Current.PhoneDialer;
                if (!phoneDialer.CanMakePhoneCall)
                {
                    UserDialogs.Instance.Alert(ResourceService.GetString("cannotCall"));
                    return;
                }
                phoneDialer.MakePhoneCall(phone.Number);
            });
            config.Add(ResourceService.GetString("messageAction"), () =>
            {
                ISmsTask smsMessenger = CrossMessaging.Current.SmsMessenger;
                if (!smsMessenger.CanSendSms)
                {
                    UserDialogs.Instance.Alert(ResourceService.GetString("cannotSms"));
                    return;
                }
                smsMessenger.SendSms(phone.Number);
            });
            config.Add(ResourceService.GetString("editAction"), () =>
            {
                EditPhone(phone);
            });
            config.Add(ResourceService.GetString("deleteAction"), () =>
            {
                if (Debtor == null || Debtor.Phones.IsNullOrEmpty())
                {
                    return;
                }

                UserDialogs.Instance.Confirm(ResourceService.GetString("reallyDelete"),
                                             ResourceService.GetString("yes"),
                                             ResourceService.GetString("no"),
                                             (accepted) =>
                {
                    if (accepted)
                    {
                        Debtor.Phones.Remove(phone);
                    }
                });
            });
            config.Add(ResourceService.GetString("cancelAction"));
            UserDialogs.Instance.ActionSheet(config);
        }
Exemple #6
0
        private void SendSms(FareType type)
        {
            if (!_smsTask.CanSendSms)
            {
                return;
            }

            if (_settingsService.LicensePlate.IsNullOrEmpty())
            {
                return;
            }

            if (_settingsService.PhoneNumber.IsNullOrEmpty())
            {
                return;
            }

            var message = type.GetMessage(_settingsService.LicensePlate);

            _smsTask.SendSms(_settingsService.PhoneNumber, message);
        }