Commit 863fa5cf by Demid Merzlyakov

IOS-102: add NUDGE_VIEW event.

parent 6881ddee
......@@ -134,6 +134,7 @@ class ShortsViewController: UIViewController {
//Check for the last row
if rowIndex == viewModel.shorts.count - 1 {
swipeHelperView.configure(forState: .downViewedAll)
analytics(log:.ANALYTICS_SHORTS_NUDGE_VIEW, params: [.ANALYTICS_KEY_SHORTS_NUDGE_VIEW_TYPE: "last_card"])
UIView.animate(withDuration: 0.3) {
self.swipeHelperView.alpha = 1
}
......@@ -143,6 +144,7 @@ class ShortsViewController: UIViewController {
if Settings.shared.shortsSwipeUpNudgeShowedCount <= ConfigManager.shared.config.shortsSwipeUpNudgeCount {
swipeHelperView.configure(forState: .upNext)
analytics(log:.ANALYTICS_SHORTS_NUDGE_VIEW, params: [.ANALYTICS_KEY_SHORTS_NUDGE_VIEW_TYPE: "swipe_up"])
UIView.animate(withDuration: 0.3) {
self.swipeHelperView.alpha = 1
}
......@@ -156,6 +158,8 @@ class ShortsViewController: UIViewController {
}
private func showUnreadShortsView(willShowRowIndex index:Int) {
analytics(log:.ANALYTICS_SHORTS_NUDGE_VIEW, params: [.ANALYTICS_KEY_SHORTS_NUDGE_VIEW_TYPE: "left_below"])
swipeUpCounter = 0
let unreadCount = max(0, viewModel.shorts.count - index)
guard unreadCount > 0 else { return }
......
......@@ -97,6 +97,7 @@ public enum AnalyticsEvent: String {
case ANALYTICS_SHORTS_READ_MORE_CLICK = "READ_MORE_CLICK"
case ANALYTICS_SHORTS_LIKE_BUTTON_CLICK = "LIKE_BUTTON_CLICK"
case ANALYTICS_SHORTS_EXIT_SHORTS_VIEW = "EXIT_SHORTS_VIEW"
case ANALYTICS_SHORTS_NUDGE_VIEW = "NUDGE_VIEW"
/// FTUE Funnel: User has saved his first city after installing the app.
case ANALYTICS_USER_QUALIFIED = "USER_QUALIFIED"
......
......@@ -25,4 +25,5 @@ public enum AnalyticsParameter: String {
case ANALYTICS_KEY_SHORTS_CARD_ID = "card_id"
case ANALYTICS_KEY_SHORTS_TIME_SPENT = "time_spent"
case ANALYTICS_KEY_SHORTS_READ_MORE_VIEW = "view"
case ANALYTICS_KEY_SHORTS_NUDGE_VIEW_TYPE = "type"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment