Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Adding lookup outstanding to ping server for ad attribution
Browse files Browse the repository at this point in the history
  • Loading branch information
soner-yuksel committed Nov 1, 2023
1 parent 79a6ee9 commit a78ff18
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions App/iOS/Delegates/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {

// We try to send DAU ping each time the app goes to foreground to work around network edge cases
// (offline, bad connection etc.).
// Also send the ping only after the URP lookup has processed.
if Preferences.URP.referralLookupOutstanding.value == false {
// Also send the ping only after the URP lookup and install attribution has processed.
if Preferences.URP.referralLookupOutstanding.value == false, Preferences.URP.installAttributionLookupOutstanding.value == false {
AppState.shared.dau.sendPingToServer()
}

Expand Down Expand Up @@ -556,6 +556,7 @@ extension BrowserViewController {
// Setting up referral code value
// This value should be set before first DAU ping
Preferences.URP.referralCode.value = refCode
Preferences.URP.installAttributionLookupOutstanding.value = false
}
}

Expand All @@ -576,7 +577,9 @@ extension BrowserViewController {
urp.referralLookup(refCode: refCode) { referralCode, offerUrl in
// Attempting to send ping after first urp lookup.
// This way we can grab the referral code if it exists, see issue #2586.
AppState.shared.dau.sendPingToServer()
if Preferences.URP.installAttributionLookupOutstanding.value == false {
AppState.shared.dau.sendPingToServer()
}
let retryTime = AppConstants.buildChannel.isPublic ? 1.days : 10.minutes
let retryDeadline = Date() + retryTime

Expand Down

0 comments on commit a78ff18

Please sign in to comment.