diff --git a/Sources/Growth/DAU.swift b/Sources/Growth/DAU.swift index 3322cde7ce9..863635c19ab 100644 --- a/Sources/Growth/DAU.swift +++ b/Sources/Growth/DAU.swift @@ -12,8 +12,16 @@ public class DAU { public static let defaultWoiDate = "2016-01-04" private static let apiVersion = 1 - private static let baseUrl = "https://laptop-updates.brave.com/\(apiVersion)/usage/ios?platform=ios" + private static var baseUrl: String { + get { + let domain = AppConstants.buildChannel == .debug || AppConstants.buildChannel == .enterprise + ? "https://laptop-updates.brave.com/" + : "https://laptop-updates.bravesoftware.com/" + + return "\(domain)\(apiVersion)/usage/ios?platform=ios" + } + } /// Number of seconds that determins when a user is "active" private let pingRefreshDuration = 5.minutes @@ -59,11 +67,6 @@ public class DAU { /// Sends ping to server and returns a boolean whether a timer for the server call was scheduled. /// A user needs to be active for a certain amount of time before we ping the server. @discardableResult public func sendPingToServer() -> Bool { - if AppConstants.buildChannel == .debug || AppConstants.buildChannel == .enterprise { - Logger.module.info("Development build detected, no server ping.") - return false - } - guard Preferences.DAU.sendUsagePing.value else { Logger.module.debug("DAU ping disabled by the user.") return false diff --git a/Tests/GrowthTests/DAUTests.swift b/Tests/GrowthTests/DAUTests.swift index 5e4cf17f043..30bc61c1279 100644 --- a/Tests/GrowthTests/DAUTests.swift +++ b/Tests/GrowthTests/DAUTests.swift @@ -322,12 +322,6 @@ class DAUTests: XCTestCase { XCTAssertEqual(singleDigitTest.mondayOfCurrentWeekFormatted, "2019-02-04") } - func testNoPingOnDevelopmentBuild() { - XCTAssertTrue(AppConstants.buildChannel == .debug) - - let dau = DAU() - XCTAssertFalse(dau.sendPingToServer()) - } func testMigratingInvalidWeekOfInstallPref() throws { // (stored, fixed)