Example #1
0
        private async Task EnablePushNotifications()
        {
            if (_pushNotificationService.IsRegistered)
            {
                return;
            }

            if (!_pushNotificationService.IsRegistered && Settings.Current.IsPushEnableAttempted)
            {
                if (await UserDialogs.Instance.ConfirmAsync("To enable push notifications, please go into Settings, Tap Notifications, and set Allow Notifications to on.",
                                                            "Enable push notifications", "Go to Settings", "Not now"))
                {
                    _pushNotificationService.OpenSettings();
                }

                return;
            }

            _pushNotificationService.RegisterForPushNotifications();
        }