Skip to content
This repository was archived by the owner on Apr 16, 2024. It is now read-only.

Commit b785107

Browse files
Merge pull request #47 from SourcePointUSA/SP-4531_fix_onAction_not_firing
Sp-4531 fix onAction not firing
2 parents eda321d + 86359df commit b785107

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CCPAConsentViewController/Classes/CCPAConsentViewController.swift

+1
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ extension CCPAConsentViewController: ConsentDelegate {
266266
}
267267

268268
public func onAction(_ action: Action, consents: PMConsents?) {
269+
consentDelegate?.onAction?(action, consents: consents)
269270
if action == .AcceptAll || action == .RejectAll || action == .SaveAndExit {
270271
sourcePoint.postAction(action: action, consentUUID: consentUUID, consents: consents) { [weak self] actionResponse, error in
271272
if let response = actionResponse {

Example/CCPAConsentViewController/ViewController.swift

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ extension ViewController: ConsentDelegate {
3838
dismiss(animated: true, completion: nil)
3939
}
4040

41+
func onAction(_ action: Action, consents: PMConsents?) {
42+
print("Action taken:", action)
43+
}
44+
4145
func onConsentReady(consentUUID: ConsentUUID, userConsent: UserConsent) {
4246
print("consentUUID:", consentUUID)
4347
print("userConsents:", userConsent)

0 commit comments

Comments
 (0)