Skip to content

Commit

Permalink
Merge branch 'develop' into MOB-2324_Disable_IDFA_alert
Browse files Browse the repository at this point in the history
  • Loading branch information
balkrishna-bv committed Jun 4, 2021
2 parents 0ae5490 + 2565a07 commit 7a36313
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 6 deletions.
6 changes: 5 additions & 1 deletion BVSwift/BVCommon/Utilities/BVFingerprint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,17 @@ internal class BVFingerprint {
}

func isAdvertisingTrackingEnabled() -> Bool {


#if !DISABLE_BVSDK_IDFA
if #available(iOS 14, *) {
return ATTrackingManager.trackingAuthorizationStatus == .authorized
}
else {
return ASIdentifierManager.shared().isAdvertisingTrackingEnabled
}
#else
return false
#endif
}
}

1 change: 1 addition & 0 deletions BVSwiftNoIDFA
10 changes: 7 additions & 3 deletions BVSwiftTests/BVConversations/Display/BVReviewQueryTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,14 @@ class BVReviewQueryTest: XCTestCase {
XCTAssertNil(syndicationSource.contentLink)
XCTAssertNotNil(syndicationSource.logoImageUrl)
}

#if SWIFT_PACKAGE
let bundle = Bundle.module
#else
let bundle = Bundle(for: type(of: self))
#endif

let path =
Bundle(for: type(of: self))
.path(forResource: "testSyndicationSource", ofType: "json")!
let path = bundle.path(forResource: "testSyndicationSource", ofType: "json")!
let url = URL(fileURLWithPath: path)
guard let fileData = try? Data(contentsOf: url) else {
XCTFail()
Expand Down
24 changes: 22 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,36 @@ let package = Package(
products: [
.library(
name: "BVSwift",
targets: ["BVSwift"]),
targets: ["BVSwift"]
),
.library(
name: "BVSwiftNoIDFA",
targets: ["BVSwiftNoIDFA"]
),
],

dependencies: [],

targets: [
.target(name: "BVSwift", path: "BVSwift", exclude: ["Support"]),
// current workaround to avoid exclusive path checks is to use a symlink:
// https://forums.swift.org/t/spm-shared-targets-files-use-case-whats-the-alternative/38888/4
// pitch with possible solution:
// https://forums.swift.org/t/pitch-mutually-exclusive-groups-of-targets/47518
.target(
name: "BVSwiftNoIDFA",
dependencies: [],
path: "BVSwiftNoIDFA",
exclude: ["Support"],
swiftSettings: [.define("DISABLE_BVSDK_IDFA")]
),
.testTarget(
name: "BVSwiftTests",
dependencies: ["BVSwift"],
path: "BVSwiftTests"),
path: "BVSwiftTests",
exclude: ["Info.plist"],
resources: [.process("MockData")]
)

]
)

0 comments on commit 7a36313

Please sign in to comment.