Skip to content

Commit

Permalink
small fixes for idfa actions
Browse files Browse the repository at this point in the history
  • Loading branch information
andresilveirah committed Aug 1, 2024
1 parent 46379f9 commit 988459a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 2 additions & 4 deletions ConsentViewController/Classes/SPConsentManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -575,11 +575,9 @@ extension SPConsentManager: SPMessageUIDelegate {
osVersion: self?.deviceManager.osVersion ?? ""
)
if status == .accepted {
action.type = .IDFAAccepted
self?.onAction(action, from: controller)
self?.onAction(SPAction(type: .IDFAAccepted, campaignType: .ios14), from: controller)
} else if status == .denied {
action.type = .IDFADenied
self?.onAction(action, from: controller)
self?.onAction(SPAction(type: .IDFADenied, campaignType: .ios14), from: controller)
}
self?.nextMessageIfAny(controller)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ class SourcepointClientCoordinator: SPClientCoordinator {
actionType: action.type,
accountId: accountId,
propertyId: propertyId,
idfaStatus: .accepted,
idfaStatus: SPIDFAStatus.current(),
metadata: .init(
gdpr: campaigns.gdpr != nil ? .init(applies: state.gdpr?.applies ?? false) : nil,
ccpa: campaigns.ccpa != nil ? .init(applies: state.ccpa?.applies ?? false) : nil,
Expand Down
2 changes: 2 additions & 0 deletions Example/ConsentViewController/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ extension ViewController: SPDelegate {
}

func onAction(_ action: SPAction, from controller: UIViewController) {
print("onAction:", action.type.description)
action.publisherData = ["foo": .init("any encodable")]
updateUI()
}

func onSPUIFinished(_ controller: UIViewController) {
Expand Down

0 comments on commit 988459a

Please sign in to comment.