public async void OnWhatsappCommand(ViewDirectorDetails studetns) { try { Device.OpenUri(new Uri("whatsapp://send?phone=+91" + studetns.contact)); } catch (Exception ex) { await App.Current.MainPage.DisplayAlert("Not Installed", "Whatsapp Not Installed", "ok"); } }
public async void OnMessageCommand(ViewDirectorDetails students) { try { var message = new SmsMessage("", students.contact); await Sms.ComposeAsync(message); } catch (FeatureNotSupportedException ex) { await App.Current.MainPage.DisplayAlert("Failed", "Sms is not supported on this device.", "OK"); } catch (Exception ex) { await App.Current.MainPage.DisplayAlert("Failed", ex.Message, "OK"); } }
public async void OnCallCommand(ViewDirectorDetails students) { try { PhoneDialer.Open(students.contact); } catch (ArgumentNullException anEx) { // Number was null or white space } catch (FeatureNotSupportedException ex) { // Phone Dialer is not supported on this device. } catch (Exception ex) { // Other error has occurred. } }