Skip to content

Conversation

@kvld
Copy link
Contributor

@kvld kvld commented Aug 7, 2017

Локальные пуши в адаптивном приложении

  • Добавлено три вида пушей:
    • Пуш о том, что вчера занимались, а сегодня ещё нет – приходит один раз, через сутки после того, как в последний раз закрыли приложение, если позавчера не занимались
    • Пуш о том, что занимаемся уже X дней подряд и неплохо бы продолжить – приходит один раз, через сутки после того, как в последний раз закрыли приложение, если занимаемся дольше дня
    • Пуш, если не занимались давно – приходит каждую неделю, первый раз через два дня после того, как в последний раз закрыли приложение

@kvld kvld added the adaptive label Aug 7, 2017
@kvld kvld self-assigned this Aug 7, 2017
@kvld kvld requested a review from Ostrenkiy August 7, 2017 11:57
@kvld
Copy link
Contributor Author

kvld commented Aug 7, 2017

@Ostrenkiy можно смотреть и предлагать ещё интересные варианты пушей.

Copy link
Contributor

@Ostrenkiy Ostrenkiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно порефакторить StatsHelper так, чтобы его апишка была удобна.
И еще - давай избавимся от ненужных getMaxStreak и updateMaxStreak в пользу более модного и удобного var maxStreak : Int { get set } ?

}
}

case tomorrow
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

уф, хорошо бы это в начало enum-а перенести


switch self {
case .tomorrow:
var curDay = StatsHelper.dayByDate(Date())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

вычисление стрика лучше вынести в отдельный метод в StatsHelper-е

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

И curDay с вот этим StatsHelper.dayByDate(Date()) тоже можно как-то туда инкапсулировать. Например, загружать сегодняшнюю статистику обращаясь к одному проперти.

@Ostrenkiy Ostrenkiy added this to the 1.40 milestone Aug 7, 2017
@Ostrenkiy Ostrenkiy merged commit d0e2ca1 into dev Aug 7, 2017
@Ostrenkiy Ostrenkiy mentioned this pull request Aug 10, 2017
@Ostrenkiy Ostrenkiy deleted the feature/adaptive-local-pns branch August 11, 2017 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants