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
d88342a7
Commit
d88342a7
authored
May 21, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IOS-74: Delay AppsFlyer initialization until privacy notice. Disable AppsFlyer if CCPA opt out.
parent
ae4ff033
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
19 deletions
+28
-19
1Weather/AppDelegate.swift
+21
-19
1Weather/Model/CCPA/CCPAHelper.swift
+7
-0
No files found.
1Weather/AppDelegate.swift
View file @
d88342a7
...
...
@@ -23,17 +23,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
private
let
appsFlyerLog
=
Logger
(
componentName
:
"AppsFlyer"
)
private
let
log
=
Logger
(
componentName
:
"AppDelegate"
)
func
application
(
_
application
:
UIApplication
,
didFinishLaunchingWithOptions
launchOptions
:
[
UIApplication
.
LaunchOptionsKey
:
Any
]?)
->
Bool
{
ThemeManager
.
refreshAppearance
()
// WDT radar setup
SwarmManager
.
sharedManager
.
authentication
=
SkywiseAuthentication
(
app_id
:
WDT_APP_ID
,
app_key
:
WDT_APP_KEY
)
self
.
window
=
UIWindow
(
frame
:
UIScreen
.
main
.
bounds
)
func
initializeAppsFlyer
()
{
appsFlyerLog
.
info
(
"AppsFlyer initialize with AppsFlyerId:
\(
kAppsFlyerId
)
, Apple App ID:
\(
kAppsFlyerAppId
)
"
)
appsFlyer
.
appsFlyerDevKey
=
kAppsFlyerId
appsFlyer
.
appleAppID
=
kAppsFlyerAppId
...
...
@@ -44,6 +34,26 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
#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
)
"
)
}
}
}
func
application
(
_
application
:
UIApplication
,
didFinishLaunchingWithOptions
launchOptions
:
[
UIApplication
.
LaunchOptionsKey
:
Any
]?)
->
Bool
{
ThemeManager
.
refreshAppearance
()
// WDT radar setup
SwarmManager
.
sharedManager
.
authentication
=
SkywiseAuthentication
(
app_id
:
WDT_APP_ID
,
app_key
:
WDT_APP_KEY
)
self
.
window
=
UIWindow
(
frame
:
UIScreen
.
main
.
bounds
)
// Note that the Amazon SDK will get assigned a proper value for consent status inside CCPAHelper.onAppLaunch
// So, make sure this call happens after the
...
...
@@ -120,14 +130,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func
applicationDidBecomeActive
(
_
application
:
UIApplication
)
{
LocationManager
.
shared
.
updateEverythingIfNeeded
()
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
)
"
)
}
}
}
func
application
(
_
application
:
UIApplication
,
didRegisterForRemoteNotificationsWithDeviceToken
deviceToken
:
Data
)
{
...
...
1Weather/Model/CCPA/CCPAHelper.swift
View file @
d88342a7
...
...
@@ -19,6 +19,7 @@ import CryptoKit
import
FBAudienceNetwork
import
PSMLocationSDK
import
DTBiOSSDK
import
AppsFlyerLib
fileprivate
let
APP_NAME
=
"ONE_WEATHER"
fileprivate
let
DEVICE_TYPE
=
"IOS"
...
...
@@ -156,6 +157,12 @@ class CCPAHelper {
// MoEngage
MoEngage
.
sharedInstance
()
.
optOut
(
ofDataTracking
:
!
canCollectData
)
AppsFlyerLib
.
shared
()
.
isStopped
=
!
canCollectData
if
canCollectData
{
let
appDelegate
=
UIApplication
.
shared
.
delegate
as?
AppDelegate
appDelegate
?
.
initializeAppsFlyer
()
}
}
private
func
registerApp
(
reason
:
String
)
{
...
...
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