Skip to content

Commit

Permalink
Merge branch 'feature/analytics_update' into 'develop'
Browse files Browse the repository at this point in the history
ADAPTY-2302 - make external analytics disabling independent from network request
  • Loading branch information
ihityouback committed Jun 3, 2021
2 parents 0f09adf + c1ee084 commit 5c875e2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Adapty/Classes/Adapty.swift
Original file line number Diff line number Diff line change
Expand Up @@ -525,12 +525,14 @@ import UIKit
@objc public class func setExternalAnalyticsEnabled(_ enabled: Bool, completion: ErrorCompletion? = nil) {
LoggerManager.logMessage("Calling now: \(#function)")

let params = Parameters.formatData(with: "", type: Constants.TypeNames.profileAnalytics, attributes: ["enabled": enabled])
DefaultsManager.shared.externalAnalyticsDisabled = !enabled

let params = Parameters.formatData(with: "",
type: Constants.TypeNames.profileAnalytics,
attributes: ["enabled": enabled])

shared.apiManager.enableAnalytics(id: shared.profileId, params: params) { (error) in
if error == nil {
DefaultsManager.shared.externalAnalyticsDisabled = !enabled

if enabled {
shared.syncInstallation()
}
Expand Down

0 comments on commit 5c875e2

Please sign in to comment.