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
7d64491a
Commit
7d64491a
authored
May 19, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IOS-74: add AppsFlyer analytics service.
parent
f1a7d6bc
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
18 deletions
+38
-18
1Weather.xcodeproj/project.pbxproj
+4
-0
1Weather/Analytics/Analytics.swift
+1
-1
1Weather/Analytics/Services/AnalyticsService.swift
+13
-0
1Weather/Analytics/Services/AppsFlyerAnalyticsService.swift
+18
-0
1Weather/Analytics/Services/FlurryAnalyticsService.swift
+1
-10
1Weather/Analytics/Services/MoEngageAnalyticsService.swift
+1
-7
No files found.
1Weather.xcodeproj/project.pbxproj
View file @
7d64491a
...
...
@@ -211,6 +211,7 @@
CE376C98261EE484000B1159
/* LaunchScreen.storyboard in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CE376C97261EE484000B1159
/* LaunchScreen.storyboard */
;
};
CE3A36C72638A77E002CACC3
/* BlendFIPSSource.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CE3A36C62638A77E002CACC3
/* BlendFIPSSource.swift */
;
};
CE3A36ED2638A825002CACC3
/* FIPSResponse.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CE3A36EC2638A825002CACC3
/* FIPSResponse.swift */
;
};
CE3C1DB6265536360031BD72
/* AppsFlyerAnalyticsService.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CE3C1DB5265536360031BD72
/* AppsFlyerAnalyticsService.swift */
;
};
CE578FD325F7E89400E8B85D
/* DayTimeWeather.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CE578FD225F7E89400E8B85D
/* DayTimeWeather.swift */
;
};
CE578FE525FB415F00E8B85D
/* CityCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CE578FE225FB415F00E8B85D
/* CityCell.swift */
;
};
CE578FE625FB415F00E8B85D
/* LocationViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CE578FE325FB415F00E8B85D
/* LocationViewController.swift */
;
};
...
...
@@ -543,6 +544,7 @@
CE376C97261EE484000B1159
/* LaunchScreen.storyboard */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
file.storyboard
;
path
=
LaunchScreen.storyboard
;
sourceTree
=
"<group>"
;
};
CE3A36C62638A77E002CACC3
/* BlendFIPSSource.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
BlendFIPSSource.swift
;
sourceTree
=
"<group>"
;
};
CE3A36EC2638A825002CACC3
/* FIPSResponse.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
FIPSResponse.swift
;
sourceTree
=
"<group>"
;
};
CE3C1DB5265536360031BD72
/* AppsFlyerAnalyticsService.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
AppsFlyerAnalyticsService.swift
;
sourceTree
=
"<group>"
;
};
CE578FD225F7E89400E8B85D
/* DayTimeWeather.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
DayTimeWeather.swift
;
sourceTree
=
"<group>"
;
};
CE578FE225FB415F00E8B85D
/* CityCell.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
CityCell.swift
;
sourceTree
=
"<group>"
;
};
CE578FE325FB415F00E8B85D
/* LocationViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
LocationViewController.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -1607,6 +1609,7 @@
CEF959642600C2F900975FAA
/* AnalyticsService.swift */
,
CEF959732600C3A400975FAA
/* FlurryAnalyticsService.swift */
,
CEF9598F2600C5A800975FAA
/* MoEngageAnalyticsService.swift */
,
CE3C1DB5265536360031BD72
/* AppsFlyerAnalyticsService.swift */
,
);
path
=
Services
;
sourceTree
=
"<group>"
;
...
...
@@ -2055,6 +2058,7 @@
CD37D3FE260DF726002669D6
/* SettingsCellFactory.swift in Sources */
,
CD8E041625F8F91B001785B6
/* ForecastCellFactory.swift in Sources */
,
87C1720D25FF870600DA3464
/* GeoNamesPlace.swift in Sources */
,
CE3C1DB6265536360031BD72
/* AppsFlyerAnalyticsService.swift in Sources */
,
CE8962A826175DF500CA274A
/* _CoreCurrentWeather.swift in Sources */
,
CEFB857A2617510700C5CDD2
/* 1WModel.xcdatamodeld in Sources */
,
CDC70833260FBFD4004A1974
/* UnitPressure+Atmosphere.swift in Sources */
,
...
...
1Weather/Analytics/Analytics.swift
View file @
7d64491a
...
...
@@ -15,7 +15,7 @@ public class Analytics {
self
.
services
=
services
}
public
static
let
shared
=
Analytics
(
services
:
[
FlurryAnalyticsService
(),
MoEngageAnalyticsService
()])
public
static
let
shared
=
Analytics
(
services
:
[
FlurryAnalyticsService
(),
MoEngageAnalyticsService
()
,
AppsFlyerAnalyticsService
()
])
public
func
log
(
event
:
AnalyticsEvent
,
params
:
[
AnalyticsParameter
:
Any
]?
=
nil
)
{
var
loggedTo
=
[
String
]()
...
...
1Weather/Analytics/Services/AnalyticsService.swift
View file @
7d64491a
...
...
@@ -12,3 +12,16 @@ public protocol AnalyticsService {
var
eventsWhitelist
:
Set
<
AnalyticsEvent
>
?
{
get
}
func
log
(
event
:
AnalyticsEvent
,
params
:
[
AnalyticsParameter
:
Any
]?)
}
extension
AnalyticsService
{
func
stringKeyedParams
(
from
params
:
[
AnalyticsParameter
:
Any
]?)
->
[
String
:
Any
]?
{
guard
let
params
=
params
else
{
return
nil
}
var
stringKeyedParams
=
[
String
:
Any
]()
for
(
key
,
value
)
in
params
{
stringKeyedParams
[
key
.
rawValue
]
=
value
}
return
stringKeyedParams
}
}
1Weather/Analytics/Services/AppsFlyerAnalyticsService.swift
0 → 100644
View file @
7d64491a
//
// AppsFlyerAnalyticsService.swift
// 1Weather
//
// Created by Demid Merzlyakov on 19.05.2021.
//
import
Foundation
import
AppsFlyerLib
internal
struct
AppsFlyerAnalyticsService
:
AnalyticsService
{
public
let
name
:
String
=
"AppsFlyer"
let
eventsWhitelist
:
Set
<
AnalyticsEvent
>
?
=
[
.
ANALYTICS_APP_OPEN
,
.
ANALYTICS_USER_QUALIFIED
,
.
ANALYTICS_D3_RETAINED
,
.
ANALYTICS_FIRST_OPEN
]
func
log
(
event
:
AnalyticsEvent
,
params
:
[
AnalyticsParameter
:
Any
]?)
{
AppsFlyerLib
.
shared
()
.
logEvent
(
event
.
rawValue
,
withValues
:
stringKeyedParams
(
from
:
params
))
}
}
1Weather/Analytics/Services/FlurryAnalyticsService.swift
View file @
7d64491a
...
...
@@ -13,15 +13,6 @@ internal struct FlurryAnalyticsService: AnalyticsService {
let
eventsWhitelist
:
Set
<
AnalyticsEvent
>
?
=
nil
func
log
(
event
:
AnalyticsEvent
,
params
:
[
AnalyticsParameter
:
Any
]?)
{
// Not sure we need this conversion
var
stringKeyedParams
:
[
String
:
Any
]?
=
nil
if
let
params
=
params
{
stringKeyedParams
=
[
String
:
Any
]()
for
(
key
,
value
)
in
params
{
stringKeyedParams
?[
key
.
rawValue
]
=
value
}
}
Flurry
.
logEvent
(
event
.
rawValue
,
withParameters
:
stringKeyedParams
)
Flurry
.
logEvent
(
event
.
rawValue
,
withParameters
:
stringKeyedParams
(
from
:
params
))
}
}
1Weather/Analytics/Services/MoEngageAnalyticsService.swift
View file @
7d64491a
...
...
@@ -13,13 +13,7 @@ internal struct MoEngageAnalyticsService: AnalyticsService {
let
eventsWhitelist
:
Set
<
AnalyticsEvent
>
?
=
nil
func
log
(
event
:
AnalyticsEvent
,
params
:
[
AnalyticsParameter
:
Any
]?)
{
var
stringKeyedParams
:
[
String
:
Any
]?
=
nil
if
let
params
=
params
{
stringKeyedParams
=
[
String
:
Any
]()
for
(
key
,
value
)
in
params
{
stringKeyedParams
?[
key
.
rawValue
]
=
value
}
}
let
stringKeyedParams
=
stringKeyedParams
(
from
:
params
)
if
let
params
=
stringKeyedParams
{
if
let
nsParams
=
(
params
as
NSDictionary
)
.
mutableCopy
()
as?
NSMutableDictionary
{
// should never fail
...
...
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