public void ShowAlertMessage(string message, ConfigurableAlertAction okAnsver, ConfigurableAlertAction dismissAnswer, ConfigurableAlertAction neutralAnsver) { Activity.RunOnUiThread(() => { var alert = new Android.App.AlertDialog.Builder(Activity); alert.SetMessage(message); alert.SetPositiveButton(okAnsver.Text, (senderAlert, args) => { okAnsver.OnClickHandler?.Invoke(); }); alert.SetNegativeButton(dismissAnswer.Text, (senderAlert, args) => { dismissAnswer.OnClickHandler?.Invoke(); }); alert.SetNeutralButton(neutralAnsver.Text, (senderAlert, args) => { neutralAnsver.OnClickHandler?.Invoke(); }); Dialog dialog = alert.Create(); dialog.Show(); }); }
public void ShowAlertMessage(string message, ConfigurableAlertAction okAnsver, ConfigurableAlertAction dismissAnswer, ConfigurableAlertAction neutralAnsver) { throw new NotImplementedException(); }
public void RefreshNotificationSettings() { var notificationStatus = SL.AppSettings.GetValueOrDefault("NotificationStatus", string.Empty); if ((notificationStatus != Enums.NotififcationStatus.Discarded.ToString()) && (notificationStatus != Enums.NotififcationStatus.Enabled.ToString())) { string message = "Challenges expire quickly - allow this app to send you push notifications to be notified about special opportunities"; if (Constants.NeedFirebaseImpl) { var _notificationService = Mvx.Resolve <IFirebaseService>(); if (_notificationService == null || !_notificationService.IsPushNotificationServiceAlailable()) { _alertService.ShowToast("Push notification service isn't alailable"); return; } var notificationOkResponse = new ConfigurableAlertAction { Text = "Yes", OnClickHandler = new Action(() => { _notificationService.RegisterPushNotificationService(); SL.AppSettings.AddOrUpdateValue("NotificationStatus", Enums.NotififcationStatus.Enabled.ToString()); }) }; var notificationCancelResponse = new ConfigurableAlertAction { Text = "No", OnClickHandler = new Action(() => { SL.AppSettings.AddOrUpdateValue("NotificationStatus", Enums.NotififcationStatus.Disabled.ToString()); }) }; var notificationNeverResponse = new ConfigurableAlertAction { Text = "Never", OnClickHandler = new Action(() => { SL.AppSettings.AddOrUpdateValue("NotificationStatus", Enums.NotififcationStatus.Discarded.ToString()); }) }; _alertService.ShowAlertMessage(message, notificationOkResponse, notificationCancelResponse, notificationNeverResponse); } else { var _notificationService = Mvx.Resolve <IPushNotificationService>(); if (_notificationService == null || !_notificationService.IsPushNotificationServiceAlailable()) { _alertService.ShowToast("Push notification service isn't alailable"); return; } var notificationOkResponse = new ConfigurableAlertAction { Text = "Yes", OnClickHandler = new Action(() => { _notificationService.RegisterPushNotificationService(); SL.AppSettings.AddOrUpdateValue("NotificationStatus", Enums.NotififcationStatus.Enabled.ToString()); }) }; var notificationCancelResponse = new ConfigurableAlertAction { Text = "No", OnClickHandler = new Action(() => { SL.AppSettings.AddOrUpdateValue("NotificationStatus", Enums.NotififcationStatus.Disabled.ToString()); }) }; var notificationNeverResponse = new ConfigurableAlertAction { Text = "Never", OnClickHandler = new Action(() => { SL.AppSettings.AddOrUpdateValue("NotificationStatus", Enums.NotififcationStatus.Discarded.ToString()); }) }; _alertService.ShowAlertMessage(message, notificationOkResponse, notificationCancelResponse, notificationNeverResponse); } } }