-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notifications request after action #245
Conversation
@kvld надо смотреть |
@Ostrenkiy а оставшиеся пункты в TODO? |
@@ -114,7 +118,7 @@ class BaseCardsStepsPresenter: CardsStepsPresenter, StepCardViewDelegate { | |||
return true | |||
} | |||
|
|||
init(stepsAPI: StepsAPI, lessonsAPI: LessonsAPI, recommendationsAPI: RecommendationsAPI, unitsAPI: UnitsAPI, viewsAPI: ViewsAPI, ratingsAPI: AdaptiveRatingsAPI, ratingManager: AdaptiveRatingManager, statsManager: AdaptiveStatsManager, storageManager: AdaptiveStorageManager, lastViewedUpdater: LocalProgressLastViewedUpdater, course: Course?, view: CardsStepsView) { | |||
init(stepsAPI: StepsAPI, lessonsAPI: LessonsAPI, recommendationsAPI: RecommendationsAPI, unitsAPI: UnitsAPI, viewsAPI: ViewsAPI, ratingsAPI: AdaptiveRatingsAPI, ratingManager: AdaptiveRatingManager, statsManager: AdaptiveStatsManager, storageManager: AdaptiveStorageManager, lastViewedUpdater: LocalProgressLastViewedUpdater, notificationSuggestionManager: NotificationSuggestionManager, notificationPermissionManager: NotificationPermissionManager, course: Course?, view: CardsStepsView) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это не ломает ничего в адаптивных таргетах?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Скорее всего ломает, сейчас посмотрю
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
пофиксил
case .authorized: | ||
self?.selectStreakNotificationTime() | ||
case .denied: | ||
//TODO: Add dialog to tell user he should have permitteed the notifications |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не делаем?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пока нет
@@ -18,25 +18,40 @@ class StreaksStepikAlertManager: AlertManager, StreaksAlertPresentationDelegate | |||
// controller.present(alert, animated: true, completion: nil) | |||
} | |||
|
|||
//TODO: Add DI here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не добавляем?
@@ -132,6 +133,10 @@ class CardsStepsViewController: UIViewController, CardsStepsView { | |||
state = .congratulation | |||
Alerts.congratulation.present(alert: controller, inController: ControllerHelper.getTopViewController() ?? self) | |||
} | |||
|
|||
func present(alertManager: AlertManager, alert: UIViewController) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
На самом деле, метод showCongratulationPopup
выше делает почти то же самое. И кажется, что он теперь не нужен. Надо или переделать сразу или как-то пометить, наверное, чтобы выпилить не в рамках этого пулл-реквеста.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пока не будем выпиливать
lastStreakAlertShownTime = Date().timeIntervalSince1970 | ||
private func setLastAlertShownTime(time: TimeInterval, for context: NotificationRequestAlertContext) { | ||
defaults.set(time, forKey: lastTimeKey(for: context)) | ||
defaults.synchronize() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
На самом деле
synchronize()
Waits for any pending asynchronous updates to the defaults database and returns; this method is unnecessary and shouldn't be used.
Stepic/en.lproj/Localizable.strings
Outdated
@@ -401,5 +401,12 @@ LessonDownloadTooltip = "Download lesson "; | |||
ContinueLearningWidgetTooltip = "Tap to continue from where you finished last time"; | |||
StreaksSwitchTooltip = "Turn on to get new portion of knowledge every day"; | |||
|
|||
/* Notification alerts */ | |||
NotificationTabNotificationRequestAlertTitle = "Stay tuned"; | |||
NotificationTabNotificationRequestAlertMessage = "We are trying to make learning process effective and comfortable. Enable notifications to follow discussions and promptly recieve courses updates?"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recieve -> receive
Stepic/en.lproj/Localizable.strings
Outdated
NotificationTabNotificationRequestAlertMessage = "We are trying to make learning process effective and comfortable. Enable notifications to follow discussions and promptly recieve courses updates?"; | ||
|
||
CourseSubscriptionNotificationRequestAlertTitle = "Stay tuned"; | ||
CourseSubscriptionNotificationRequestAlertMessage = "We are trying to make learning process effective and comfortable. Enable notifications to follow deadlines and promptly recieve course updates?"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recieve -> receive
Задача: #APPS-1792 #APPS-1732
Коротко для Release Notes, в формате «Сделали/Добавили/Исправили N»:
Запрашиваем разрешение на уведомления красиво и в тот момент, когда пользователь хочет ответить "да"
Описание:
С помощью
NotificationPermissionManager
теперь контролируем то, как пользователь записывается на уведомления. В алерте показываем анимацию с колокольчиком с помощью Lottie. С помощьюNotificationSuggestionManager
мы контролируем частоту и интервалы показа уведомлений.StreakAlertViewController
превратили вNotificationRequestAlertViewController
, который переиспользуем для отображения алертов про разрешение нотификаций.TODO
StreakAlertViewController
->NotificationRequestAlertViewController
, в котором можно выбирать отображаемый текст в зависимости от контекста.