Skip to content

Commit eb19a5d

Browse files
committed
fixed rare bug related to A/B testing analytics
1 parent f4154d0 commit eb19a5d

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

ApphudSDK.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'ApphudSDK'
3-
s.version = '3.3.7'
3+
s.version = '3.3.8'
44
s.summary = 'Build and Measure In-App Subscriptions on iOS.'
55
s.description = 'Apphud covers every aspect when it comes to In-App Subscriptions from integration to analytics on iOS and Android.'
66
s.homepage = 'https://github.com/apphud/ApphudSDK'

Sources/Internal/ApphudInternal+Product.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ extension ApphudInternal {
4848
}
4949

5050
internal func fetchAllAvailableProductIDs() async -> Set<String> {
51-
await withCheckedContinuation({ continuation in
51+
52+
if await permissionGroups == nil {
53+
_ = await fetchPermissionGroups()
54+
}
55+
56+
return await withCheckedContinuation({ continuation in
5257
performWhenUserRegistered(allowFailure: true) { @MainActor in
5358
continuation.resume(returning: self.allAvailableProductIDs())
5459
}

Sources/Internal/ApphudInternal+Purchase.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,13 @@ extension ApphudInternal {
329329
}
330330
}
331331
#endif
332-
332+
333+
if let transactionId = params["transaction_id"] as? String, let trInt = UInt64(transactionId) {
334+
var trx = self.lastUploadedTransactions
335+
trx.append(trInt)
336+
self.lastUploadedTransactions = trx
337+
}
338+
333339
self.requiresReceiptSubmission = true
334340

335341
apphudLog("Uploading App Store Receipt...")
@@ -367,6 +373,7 @@ extension ApphudInternal {
367373
self.notifyAboutUpdates(hasChanges)
368374
}
369375
} else {
376+
self.lastUploadedTransactions = []
370377
self.scheduleSubmitReceiptRetry(error: error, code: errorCode)
371378
}
372379

Sources/Public/Apphud.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import Foundation
1414
import UserNotifications
1515
import SwiftUI
1616

17-
internal let apphud_sdk_version = "3.3.7"
17+
internal let apphud_sdk_version = "3.3.8"
1818

1919
// MARK: - Initialization
2020

0 commit comments

Comments
 (0)