Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
1
1weather
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
1weather
Commits
dad43b2e
Commit
dad43b2e
authored
Jul 15, 2021
by
Dmitriy Stepanets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added analytics to widget promo controller
parent
a7dbecdb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
6 deletions
+31
-6
1Weather.xcodeproj/xcuserdata/dstepanets.xcuserdatad/xcschemes/xcschememanagement.plist
+2
-2
1Weather/AppDelegate.swift
+0
-1
1Weather/UI/View controllers/WidgetPromotion/WidgetPromotionController.swift
+23
-3
OneWeatherAnalytics/OneWeatherAnalytics/AnalyticsEvent.swift
+6
-0
No files found.
1Weather.xcodeproj/xcuserdata/dstepanets.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
dad43b2e
...
@@ -12,12 +12,12 @@
...
@@ -12,12 +12,12 @@
<
k
e
y
>
OneWeatherNotificationServiceExtension.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
k
e
y
>
OneWeatherNotificationServiceExtension.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
1
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
2
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
k
e
y
>
OneWeatherWidgetExtension.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
k
e
y
>
OneWeatherWidgetExtension.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
2
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
4
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
k
e
y
>
PG
(
Playground
)
1.xcscheme
<
/k
e
y
>
<
k
e
y
>
PG
(
Playground
)
1.xcscheme
<
/k
e
y
>
<
d
i
c
t
>
<
d
i
c
t
>
...
...
1Weather/AppDelegate.swift
View file @
dad43b2e
...
@@ -17,7 +17,6 @@ import OneWeatherCore
...
@@ -17,7 +17,6 @@ import OneWeatherCore
import
AppsFlyerLib
import
AppsFlyerLib
import
OneWeatherAnalytics
import
OneWeatherAnalytics
import
WDTWeatherSource
import
WDTWeatherSource
import
BlendHealthSource
import
BlendHealthSource
import
BlendFIPSSource
import
BlendFIPSSource
...
...
1Weather/UI/View controllers/WidgetPromotion/WidgetPromotionController.swift
View file @
dad43b2e
...
@@ -6,12 +6,13 @@
...
@@ -6,12 +6,13 @@
//
//
import
UIKit
import
UIKit
import
OneWeatherAnalytics
@available(iOS 14, *)
@available(iOS 14, *)
class
WidgetPromotionController
:
UIViewController
{
class
WidgetPromotionController
:
UIViewController
{
//Private
//Private
private
let
kPanTopInset
:
CGFloat
=
10
private
let
kPanTopInset
:
CGFloat
=
10
private
let
kScrollViewTopInset
:
CGFloat
=
36
private
let
kScrollViewTopInset
:
CGFloat
=
42
private
let
coordinator
:
WidgetPromotionCoordinator
private
let
coordinator
:
WidgetPromotionCoordinator
private
let
controllerPanView
=
UIView
()
private
let
controllerPanView
=
UIView
()
private
let
closeButton
=
UIButton
()
private
let
closeButton
=
UIButton
()
...
@@ -35,7 +36,7 @@ class WidgetPromotionController: UIViewController {
...
@@ -35,7 +36,7 @@ class WidgetPromotionController: UIViewController {
let
safeAreaInset
=
UIApplication
.
shared
.
keyWindow
?
.
safeAreaInsets
.
bottom
??
0
let
safeAreaInset
=
UIApplication
.
shared
.
keyWindow
?
.
safeAreaInsets
.
bottom
??
0
let
contentHeight
=
pan
+
kScrollViewTopInset
+
stackHeight
+
scrollViewBottomInset
+
footerHeight
+
safeAreaInset
let
contentHeight
=
pan
+
kScrollViewTopInset
+
stackHeight
+
scrollViewBottomInset
+
footerHeight
+
safeAreaInset
let
height
=
min
(
contentHeight
,
UIScreen
.
main
.
bounds
.
height
*
0.
85
)
let
height
=
min
(
contentHeight
,
UIScreen
.
main
.
bounds
.
height
*
0.
9
)
return
height
return
height
}
}
...
@@ -57,6 +58,20 @@ class WidgetPromotionController: UIViewController {
...
@@ -57,6 +58,20 @@ class WidgetPromotionController: UIViewController {
prepareScrollView
()
prepareScrollView
()
prepareStackView
()
prepareStackView
()
updateUI
()
updateUI
()
AppAnalytics
.
shared
.
log
(
event
:
.
ANALYTICS_WIDGET_PROMO_SEEN
)
#warning("--LOOK-")
//In this version the promo controller opens fully everytime
AppAnalytics
.
shared
.
log
(
event
:
.
ANALYTICS_WIDGET_PROMO_EXPAND
)
}
override
func
viewDidAppear
(
_
animated
:
Bool
)
{
super
.
viewDidAppear
(
animated
)
if
scrollView
.
frame
.
height
>
scrollView
.
contentSize
.
height
{
AppAnalytics
.
shared
.
log
(
event
:
.
ANALYTICS_WIDGET_BOTTOM_SCROLLED
)
}
}
}
required
init
?(
coder
:
NSCoder
)
{
required
init
?(
coder
:
NSCoder
)
{
...
@@ -66,6 +81,7 @@ class WidgetPromotionController: UIViewController {
...
@@ -66,6 +81,7 @@ class WidgetPromotionController: UIViewController {
private
func
close
()
{
private
func
close
()
{
self
.
dismiss
(
animated
:
true
)
{
self
.
dismiss
(
animated
:
true
)
{
self
.
coordinator
.
viewControllerDidEnd
(
controller
:
self
)
self
.
coordinator
.
viewControllerDidEnd
(
controller
:
self
)
AppAnalytics
.
shared
.
log
(
event
:
.
ANALYTICS_WIDGET_PROMO_DISMISS
)
}
}
}
}
...
@@ -78,6 +94,7 @@ class WidgetPromotionController: UIViewController {
...
@@ -78,6 +94,7 @@ class WidgetPromotionController: UIViewController {
if
UIApplication
.
shared
.
canOpenURL
(
learnURL
)
{
if
UIApplication
.
shared
.
canOpenURL
(
learnURL
)
{
UIApplication
.
shared
.
open
(
learnURL
,
options
:
[:])
UIApplication
.
shared
.
open
(
learnURL
,
options
:
[:])
AppAnalytics
.
shared
.
log
(
event
:
.
ANALYTICS_WIDGET_PROMO_LEARN_CTA
)
close
()
close
()
}
}
}
}
...
@@ -169,7 +186,7 @@ private extension WidgetPromotionController {
...
@@ -169,7 +186,7 @@ private extension WidgetPromotionController {
scrollView
.
snp
.
makeConstraints
{
make
in
scrollView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
left
.
right
.
equalToSuperview
()
make
.
top
.
equalToSuperview
()
.
inset
(
kScrollViewTopInset
)
make
.
top
.
equalToSuperview
()
.
inset
(
kScrollViewTopInset
)
make
.
bottom
.
equalTo
(
footerView
.
snp
.
top
)
.
offset
(
8
)
make
.
bottom
.
equalTo
(
footerView
.
snp
.
top
)
.
offset
(
-
8
)
}
}
}
}
...
@@ -236,6 +253,9 @@ extension WidgetPromotionController: UIViewControllerTransitioningDelegate {
...
@@ -236,6 +253,9 @@ extension WidgetPromotionController: UIViewControllerTransitioningDelegate {
@available(iOS 14, *)
@available(iOS 14, *)
extension
WidgetPromotionController
:
UIScrollViewDelegate
{
extension
WidgetPromotionController
:
UIScrollViewDelegate
{
func
scrollViewDidScroll
(
_
scrollView
:
UIScrollView
)
{
func
scrollViewDidScroll
(
_
scrollView
:
UIScrollView
)
{
if
scrollView
.
contentOffset
.
y
==
scrollView
.
contentSize
.
height
-
scrollView
.
frame
.
height
{
AppAnalytics
.
shared
.
log
(
event
:
.
ANALYTICS_WIDGET_BOTTOM_SCROLLED
)
}
// if scrollView.contentOffset.y < 0 {
// if scrollView.contentOffset.y < 0 {
// let originalOffsetY = UIScreen.main.bounds.height - self.view.bounds.height
// let originalOffsetY = UIScreen.main.bounds.height - self.view.bounds.height
// view.frame.origin.y = originalOffsetY - (scrollView.contentOffset.y - initialTouchPoint.y)
// view.frame.origin.y = originalOffsetY - (scrollView.contentOffset.y - initialTouchPoint.y)
...
...
OneWeatherAnalytics/OneWeatherAnalytics/AnalyticsEvent.swift
View file @
dad43b2e
...
@@ -89,6 +89,12 @@ public enum AnalyticsEvent: String {
...
@@ -89,6 +89,12 @@ public enum AnalyticsEvent: String {
case
ANALYTICS_A9_BID_RECEIVED
=
"A9_BID_RECEIVED"
case
ANALYTICS_A9_BID_RECEIVED
=
"A9_BID_RECEIVED"
case
ANALYTICS_AD_CLICKED
=
"AD_CLICKED"
case
ANALYTICS_AD_CLICKED
=
"AD_CLICKED"
case
ANALYTICS_APP_OPEN
=
"APP_OPEN"
case
ANALYTICS_APP_OPEN
=
"APP_OPEN"
case
ANALYTICS_WIDGET_PROMO_SEEN
=
"WIDGET_PROMO_SEEN"
case
ANALYTICS_WIDGET_PROMO_DISMISS
=
"WIDGET_PROMO_DISMISS"
case
ANALYTICS_WIDGET_PROMO_EXPAND
=
"WIDGET_PROMO_EXPAND"
case
ANALYTICS_WIDGET_BOTTOM_SCROLLED
=
"WIDGET_PROMO_BOTTOM_SCROLLED"
case
ANALYTICS_WIDGET_PROMO_LEARN_CTA
=
"WIDGET_PROMO_LEARN_CTA"
/// FTUE Funnel: User has saved his first city after installing the app.
/// FTUE Funnel: User has saved his first city after installing the app.
case
ANALYTICS_USER_QUALIFIED
=
"USER_QUALIFIED"
case
ANALYTICS_USER_QUALIFIED
=
"USER_QUALIFIED"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment