-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #580 from SourcePointUSA/DIA-4457_mobile-core_meta…
…data DIA-4457 use mobile-core metadata
- Loading branch information
Showing
194 changed files
with
25,109 additions
and
5,583 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
ConsentViewController/Classes/SourcePointClient/Adapters.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// | ||
// Adapters.swift | ||
// Pods | ||
// | ||
// Created by Andre Herculano on 10/9/24. | ||
// | ||
|
||
import Foundation | ||
import SPMobileCore | ||
|
||
// swiftlint:disable force_unwrapping | ||
|
||
extension SPDate { | ||
init(string: String) { | ||
originalDateString = string | ||
date = Self.format.date(from: originalDateString) ?? Date() | ||
} | ||
} | ||
|
||
extension MetaDataQueryParam { | ||
func toCore() -> MetaDataRequest.Campaigns { | ||
.init( | ||
gdpr: gdpr != nil ? .init(groupPmId: gdpr?.groupPmId) : nil, | ||
usnat: usnat != nil ? .init(groupPmId: usnat?.groupPmId) : nil, | ||
ccpa: ccpa != nil ? .init(groupPmId: ccpa?.groupPmId) : nil | ||
) | ||
} | ||
} | ||
|
||
extension SPMobileCore.MetaDataResponse { | ||
func toNative() -> MetaDataResponse { | ||
.init( | ||
ccpa: ccpa != nil ? .init( | ||
applies: ccpa!.applies, | ||
sampleRate: ccpa!.sampleRate | ||
) : nil, | ||
gdpr: gdpr != nil ? .init( | ||
additionsChangeDate: SPDate(string: gdpr!.additionsChangeDate), | ||
legalBasisChangeDate: SPDate(string: gdpr!.legalBasisChangeDate), | ||
vendorListId: gdpr!.vendorListId, | ||
childPmId: gdpr!.childPmId, | ||
applies: gdpr!.applies, | ||
sampleRate: gdpr!.sampleRate | ||
) : nil, | ||
usnat: usnat != nil ? .init( | ||
vendorListId: usnat!.vendorListId, | ||
additionsChangeDate: SPDate(string: usnat!.additionsChangeDate), | ||
applies: usnat!.applies, | ||
sampleRate: usnat!.sampleRate, | ||
applicableSections: usnat!.applicableSections.map { Int(truncating: $0) } | ||
) : nil | ||
) | ||
} | ||
} | ||
|
||
// swiftlint:enable force_unwrapping |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
Example/Pods/Local Podspecs/ConsentViewController.podspec.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.