Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Set analytics consent to false by default #2022 #2074

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Apps/RuuviStation/Sources/Classes/Routers/AppRouter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ final class AppRouter {
var settings: RuuviLocalSettings!
var ruuviAnalytics: RuuviAnalytics!

private var analyticsConsentGiven: Bool = false

// navigation controller
private var navigationController: UINavigationController {
if let navigationController = weakNavigationController {
Expand Down Expand Up @@ -127,15 +129,16 @@ extension AppRouter: OnboardRouterDelegate {
_ router: OnboardRouter,
consentGiven: Bool
) {
ruuviAnalytics.setConsent(
allowed: consentGiven
)
analyticsConsentGiven = consentGiven
}

private func presentDashboard() {
settings.welcomeShown = true
settings.tosAccepted = true
settings.analyticsConsentGiven = true
ruuviAnalytics.setConsent(
allowed: analyticsConsentGiven
)
AppUtility.lockOrientation(.all)
let controller = dashboardViewController()
navigationController.setNavigationBarHidden(false, animated: false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,11 @@ private extension RuuviOnboardSignInCell {
extension RuuviOnboardSignInCell {
func configure(
with viewModel: OnboardViewModel,
tosAccepted: Bool,
analyticsConsentGiven: Bool
) {
tosAccepted: Bool) {
titleLabel.text = viewModel.title
subtitleLabel.text = viewModel.subtitle
tosCheckbox.setChecked(tosAccepted)
analyticsCheckbox.setChecked(analyticsConsentGiven)
analyticsCheckbox.setChecked(false)
setContinueButtonEnabled(tosAccepted)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,7 @@ extension RuuviOnboardViewController {
cell?.delegate = self
cell?.configure(
with: viewModel,
tosAccepted: tosAccepted,
analyticsConsentGiven: analyticsConsentGiven
tosAccepted: tosAccepted
)
return cell
}
Expand Down
Loading