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
1cc18a84
Commit
1cc18a84
authored
May 26, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/IOS-74-apps-flyer' into develop
parents
64065d75
aa68175d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
20 deletions
+43
-20
1Weather/Analytics/AnalyticsParameter.swift
+1
-0
1Weather/AppDelegate.swift
+42
-20
No files found.
1Weather/Analytics/AnalyticsParameter.swift
View file @
1cc18a84
...
...
@@ -20,4 +20,5 @@ public enum AnalyticsParameter: String {
case
ANALYTICS_KEY_AD_ADAPTER
=
"AD_ADAPTER"
case
ANALYTICS_KEY_PUSH_NOTIFICATION_SOURCE
=
"source"
case
ANALYTICS_KEY_THEME_CHANGE_NAME
=
"themeName"
case
ANALYTICS_KEY_FIST_OPEN_SOURCE
=
"Source"
}
1Weather/AppDelegate.swift
View file @
1cc18a84
...
...
@@ -24,30 +24,23 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
private
let
appsFlyerLog
=
Logger
(
componentName
:
"AppsFlyer"
)
private
let
log
=
Logger
(
componentName
:
"AppDelegate"
)
func
initializeAppsFlyer
()
{
appsFlyerLog
.
info
(
"AppsFlyer initialize with AppsFlyerId:
\(
kAppsFlyerId
)
, Apple App ID:
\(
kAppsFlyerAppId
)
"
)
appsFlyer
.
appsFlyerDevKey
=
kAppsFlyerId
appsFlyer
.
appleAppID
=
kAppsFlyerAppId
appsFlyer
.
delegate
=
self
appsFlyer
.
deepLinkDelegate
=
self
#if DEBUG
appsFlyer
.
isDebug
=
true
#else
appsFlyer
.
isDebug
=
false
#endif
appsFlyer
.
start
{
[
weak
self
]
dictionary
,
error
in
if
let
error
=
error
{
self
?
.
appsFlyerLog
.
error
(
"AppsFlyer start error:
\(
error
)
"
)
}
else
{
self
?
.
appsFlyerLog
.
info
(
"AppsFlyer start result:
\(
dictionary
)
"
)
}
}
private
enum
FirstOpenSource
:
String
{
case
icon
=
"Icon"
case
url
=
"Push Notification"
case
pushNotification
=
"Share Deeplink"
}
func
application
(
_
application
:
UIApplication
,
didFinishLaunchingWithOptions
launchOptions
:
[
UIApplication
.
LaunchOptionsKey
:
Any
]?)
->
Bool
{
ThemeManager
.
refreshAppearance
()
if
let
launchOptions
=
launchOptions
{
log
.
debug
(
"Launch options:
\(
launchOptions
)
"
)
}
else
{
log
.
debug
(
"Launch options: -"
)
}
// WDT radar setup
SwarmManager
.
sharedManager
.
authentication
=
SkywiseAuthentication
(
app_id
:
WDT_APP_ID
,
...
...
@@ -60,7 +53,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// So, make sure this call happens after the
CCPAHelper
.
shared
.
onAppLaunch
()
if
CCPAHelper
.
shared
.
isNewUser
&&
Settings
.
shared
.
firstOpenDate
==
nil
{
analytics
(
log
:
.
ANALYTICS_FIRST_OPEN
)
var
firstOpenSource
=
FirstOpenSource
.
icon
if
launchOptions
?[
.
remoteNotification
]
!=
nil
{
firstOpenSource
=
.
pushNotification
}
else
if
launchOptions
?[
.
url
]
!=
nil
{
firstOpenSource
=
.
url
}
analytics
(
log
:
.
ANALYTICS_FIRST_OPEN
,
params
:
[
.
ANALYTICS_KEY_FIST_OPEN_SOURCE
:
firstOpenSource
.
rawValue
])
Settings
.
shared
.
firstOpenDate
=
Date
()
}
...
...
@@ -136,6 +137,27 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func
application
(
_
application
:
UIApplication
,
didRegisterForRemoteNotificationsWithDeviceToken
deviceToken
:
Data
)
{
PushNotificationsManager
.
shared
.
set
(
pushToken
:
deviceToken
)
}
func
initializeAppsFlyer
()
{
appsFlyerLog
.
info
(
"AppsFlyer initialize with AppsFlyerId:
\(
kAppsFlyerId
)
, Apple App ID:
\(
kAppsFlyerAppId
)
"
)
appsFlyer
.
appsFlyerDevKey
=
kAppsFlyerId
appsFlyer
.
appleAppID
=
kAppsFlyerAppId
appsFlyer
.
delegate
=
self
appsFlyer
.
deepLinkDelegate
=
self
#if DEBUG
appsFlyer
.
isDebug
=
true
#else
appsFlyer
.
isDebug
=
false
#endif
appsFlyer
.
start
{
[
weak
self
]
dictionary
,
error
in
if
let
error
=
error
{
self
?
.
appsFlyerLog
.
error
(
"AppsFlyer start error:
\(
error
)
"
)
}
else
{
self
?
.
appsFlyerLog
.
info
(
"AppsFlyer start result:
\(
dictionary
)
"
)
}
}
}
}
extension
AppDelegate
:
AppsFlyerLibDelegate
{
...
...
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