Esempio n. 1
0
        protected async override void OnAppearing()
        {
            base.OnAppearing();

            await Permissions.RequestAsync <Permissions.ContactsRead>();

            ContactPeople = SimpleInjections.GetContactPeople();

            try
            {
                HttpClient client = new HttpClient();

                HttpResponseMessage response = await client.GetAsync("https://google.com/");

                if (response.IsSuccessStatusCode)
                {
                    await response.Content.ReadAsStreamAsync();

                    ConnectivityStatus = "😊";
                }
            }
            catch
            {
                ConnectivityStatus = "😕";
            }
        }
Esempio n. 2
0
        public MainPage()
        {
            InitializeComponent();

            CallNumberCommand = new Command <ContactNumber>(async contactNumber =>
            {
                if (contactNumber.Type == "📷")
                {
                    SimpleInjections.OpenWhatsAppContact(contactNumber.Number);
                }
                else
                {
                    await Permissions.RequestAsync <Permissions.Phone>();

                    SimpleInjections.CallNumber(contactNumber.Number);
                }
            });

            PlayDisplayNameCommand = new Command <ContactPerson>(async contact =>
            {
                SimpleInjections.PlayVoice($"http://api.farsireader.com/ArianaCloudService/ReadTextGET?APIKey=$JPK7Q2IRVPJHWKQ5A&Text={contact.DisplayName}&Speaker=Female1&Format=mp3");
            });
        }