Skip to content

Commit 9bdedad

Browse files
authored
Merge pull request #337 from SourcePointUSA/develop
Merge develop to master
2 parents 6ca78b8 + 09f5c25 commit 9bdedad

File tree

99 files changed

+2170
-1814
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+2170
-1814
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 6.1.7 (August, 25, 2021)
2+
* Added `acceptedCategories` property to `SPGDPRConsent` class. The `acceptedCategories` is an array of ids of the categories (purposes) consented by the user and that are consented in all vendors involved with it. If a single vendor of a given purpose is disabled by the user, that purpose won't be part of `acceptedCategories`. [#335](https://github.com/SourcePointUSA/ios-cmp-app/pull/335)
3+
* Fixed an issue preventing using the SDK with Carthage. [#334](https://github.com/SourcePointUSA/ios-cmp-app/pull/334)
4+
15
# 6.1.6 (August, 17, 2021)
26
* Added `IDFAAccepted` & `IDFADenied` to `SPActionType` to load the messages based on IDFA status [#330](https://github.com/SourcePointUSA/ios-cmp-app/pull/330)
37

ConsentViewController.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'ConsentViewController'
3-
s.version = '6.1.6'
3+
s.version = '6.1.7'
44
s.summary = 'SourcePoint\'s ConsentViewController to handle privacy consents.'
55
s.homepage = 'https://www.sourcepoint.com'
66
s.license = { :type => 'MIT', :file => 'LICENSE' }

ConsentViewController/Classes/Consents/SPGDPRConsent.swift

+13
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,19 @@ public typealias SPGDPRPurposeId = String
6767
/// that's the internal Sourcepoint id we give to this consent profile
6868
public var uuid: String?
6969

70+
/// a list of ids of the categories accepted by the user in all its vendors.
71+
/// If a category has been rejected in a single vendor, its id won't part of the `acceptedCategories` list.
72+
public var acceptedCategories: [String] {
73+
let categoryGrants = vendorGrants
74+
.flatMap { $0.value.purposeGrants }
75+
return Set<String>(categoryGrants.map { $0.key })
76+
.filter { id in
77+
categoryGrants
78+
.filter { $0.key == id }
79+
.allSatisfy { $0.value }
80+
}
81+
}
82+
7083
public init(
7184
uuid: String? = nil,
7285
vendorGrants: SPGDPRVendorGrants,

Example/ConsentViewController.xcworkspace/xcshareddata/swiftpm/Package.resolved

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"repositoryURL": "https://github.com/SourcePointUSA/ios-cmp-app.git",
77
"state": {
88
"branch": null,
9-
"revision": "a7bf6b6a795b5909d69846fa6a5873065d511296",
10-
"version": "6.1.2"
9+
"revision": "118d527955040e507c04dc886d46bcfc66dfb8a3",
10+
"version": "6.1.5"
1111
}
1212
}
1313
]

Example/ConsentViewController_ExampleTests/GDPRUserConsentsSpec.swift

+21
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,26 @@ class SPGDPRConsentsSpec: QuickSpec {
3636
expect(SPGDPRConsent.CodingKeys.tcfData.rawValue).to(equal("TCData"))
3737
}
3838
}
39+
40+
describe("acceptedCategories") {
41+
it("contains all purposes accepted in *all* vendors") {
42+
let consent = SPGDPRConsent(
43+
vendorGrants: [
44+
"vendor1": SPGDPRVendorGrant(granted: false, purposeGrants: [
45+
"purpose1": true,
46+
"purpose2": false
47+
]),
48+
"vendor2": SPGDPRVendorGrant(granted: false, purposeGrants: [
49+
"purpose1": true,
50+
"purpose3": true
51+
])
52+
],
53+
euconsent: "",
54+
tcfData: SPJson()
55+
)
56+
expect(consent.acceptedCategories).to(contain(["purpose1", "purpose3"]))
57+
expect(consent.acceptedCategories).notTo(contain(["purpose2"]))
58+
}
59+
}
3960
}
4061
}

Example/ConsentViewController_ExampleTests/Helpers/InMemoryStorageMock.swift

+7-3
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@ import Foundation
1111

1212
/// A class that uses [String: Any] as its storage
1313
class InMemoryStorageMock: Storage {
14+
func integer(forKey defaultName: String) -> Int {
15+
storage[defaultName] as? Int ?? 0
16+
}
17+
1418
var storage = [String: Any]()
1519

1620
func string(forKey defaultName: String) -> String? {
17-
return storage[defaultName] as? String
21+
storage[defaultName] as? String
1822
}
1923

2024
func object<T>(ofType type: T.Type, forKey defaultName: String) -> T? where T: Decodable {
21-
return storage[defaultName] as? T
25+
storage[defaultName] as? T
2226
}
2327

2428
func set(_ value: Any?, forKey defaultName: String) {
@@ -42,6 +46,6 @@ class InMemoryStorageMock: Storage {
4246
}
4347

4448
func dictionaryRepresentation() -> [String: Any] {
45-
return storage
49+
storage
4650
}
4751
}

Example/ConsentViewController_ExampleTests/Helpers/SourcePointClientMock.swift

-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ class SourcePointClientMock: SourcePointProtocol {
2323
print("getNativePrivacyManager")
2424
}
2525

26-
func mmsMessage(messageId: Int, handler: @escaping MMSMessageHandler) {
27-
print("mmsMessage")
28-
}
29-
3026
func privacyManagerView(propertyId: Int, consentLanguage: SPMessageLanguage, handler: @escaping PrivacyManagerViewHandler) {
3127
print("privacyManagerView")
3228
}

Example/Podfile.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- ConsentViewController (6.1.6)
2+
- ConsentViewController (6.1.7)
33
- IQKeyboardManagerSwift (6.5.6)
44
- Nimble (9.2.0)
55
- Quick (4.0.0)
@@ -27,7 +27,7 @@ EXTERNAL SOURCES:
2727
:path: "../"
2828

2929
SPEC CHECKSUMS:
30-
ConsentViewController: 43e5c9463a6eacdffb15a227d34b4ab609968e53
30+
ConsentViewController: 04f325671502479b8774f3a8a12bc64190e9ac3c
3131
IQKeyboardManagerSwift: c7df9d2deb356c04522f5c4b7b6e4ce4d8ed94fe
3232
Nimble: 4f4a345c80b503b3ea13606a4f98405974ee4d0b
3333
Quick: 6473349e43b9271a8d43839d9ba1c442ed1b7ac4
@@ -36,4 +36,4 @@ SPEC CHECKSUMS:
3636

3737
PODFILE CHECKSUM: f8658d9830917d40ea1c48103e6c8fd3421a7fb5
3838

39-
COCOAPODS: 1.10.1
39+
COCOAPODS: 1.11.0.beta.2

Example/Pods/Local Podspecs/ConsentViewController.podspec.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Manifest.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)