private async void NotifyAboutPermissionsChange() { bool isEnabled; try { isEnabled = await Xamarin.ExposureNotifications.ExposureNotification.IsEnabledAsync(); } catch (Exception e) { // To make it not crash on devices with normal Play Services before the app is whitelisted if (e.HandleExposureNotificationException(nameof(PermissionsBroadcastReceiver), nameof(NotifyAboutPermissionsChange))) { isEnabled = false; } else { throw e; } } if (!_permissionsUtils.HasPermissionsWithoutDialogs() && isEnabled) { PermissionsMessagingCenter.NotifyPermissionsChanged(this); } }
public void UnsubscribePermissionsMessagingCenter(object subscriber) { PermissionsMessagingCenter.Unsubscribe(subscriber); }
public void SubscribePermissionsMessagingCenter(object subscriber, Action <object> action) { PermissionsMessagingCenter.SubscribeForPermissionsChanged(subscriber, action); }