You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
canShowFirstTime=false stamps shown time = now, starting the interval clock without an ad shown #22
In GADManager.canShow(_:), when canShowFirstTime == false and the delegate's last shown time is <= 1970, the first-time skip calls updatShownTimeForUnit(showTime: now).
That records "skipped" as "shown now", so the unit's interval clock starts although no ad was shown. The first real ad is then blocked until interval elapses.
Relaunch within 30m → stock → detail → back: no ad (expected: ad shows).
Proposed fix
Stamp Date(timeIntervalSince1970: 1) instead of now:
the stored value becomes > 1970, so the first-time guard passes on later checks;
spent is huge, so it is > interval and the next check can show an ad.
Caveat: with only that change, later canShow calls in the same launch return true too, so the skip covers just the first check, not the whole first launch. To block the full first launch, also keep an in-memory per-unit flag (e.g. skippedFirstTime: Set<E>) that makes canShow return false for the rest of this process.
Workaround in app
2sem/relatedstocks-app-ios#161 blocks the first launch in the app via the delegate and sets canShowFirstTime = true.
Activity