Skip to content

Commit 477127a

Browse files
committed
display receipt: fix isOptOut condition
the missing key wasn't checked properly, the opt out only worked when it was missing
1 parent fe6fcfa commit 477127a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Swift/Display Receipt/DisplayReceiptCacheHelper.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ internal struct DisplayReceiptCacheHelper {
121121

122122
func isOptOut() throws -> Bool {
123123
let defaults = try appInformationProvider.sharedDefaults()
124-
if defaults.object(forKey: "batch_shared_optout") != nil {
124+
if defaults.object(forKey: "batch_shared_optout") == nil {
125125
// Key is missing, we don't send display receipt
126126
return true
127127
}

0 commit comments

Comments
 (0)