Skip to content

Commit

Permalink
Merge branch 'develop' into feature/purchasing-api
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuftor committed Sep 30, 2024
2 parents bf6a9cc + 7ea8255 commit 4a2a467
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

The changelog for `SuperwallKit`. Also see the [releases](https://github.com/superwall/Superwall-iOS/releases) on GitHub.

## 3.9.2

### Fixes

- Tweaks AdServices token logic to prevent getting the token twice.

## 3.9.1

### Fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import Foundation
final class AttributionPoster {
private let attributionFetcher = AttributionFetcher()
private let collectAdServicesAttribution: Bool
private var isCollecting = false

private unowned let storage: Storage

private var adServicesTokenToPostIfNeeded: String? {
Expand Down Expand Up @@ -52,6 +54,9 @@ final class AttributionPoster {
guard Superwall.isInitialized else {
return
}
if isCollecting {
return
}
Task(priority: .background) {
if #available(iOS 14.3, macOS 11.1, macCatalyst 14.3, *) {
await getAdServicesTokenIfNeeded()
Expand All @@ -65,7 +70,11 @@ final class AttributionPoster {
@available(tvOS, unavailable)
@available(watchOS, unavailable)
func getAdServicesTokenIfNeeded() async {
defer {
isCollecting = false
}
do {
isCollecting = true
guard collectAdServicesAttribution else {
return
}
Expand Down

0 comments on commit 4a2a467

Please sign in to comment.