Skip to content

Commit

Permalink
Merge pull request #25 from audienceproject/feature/fix-crash-if-no-t…
Browse files Browse the repository at this point in the history
…racking-param

fix app crash if user did not set NSUserTrackingUsageDescription param
  • Loading branch information
vachumakov authored Aug 12, 2024
2 parents bb63dd8 + 553edb9 commit fd6aa16
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions UserReport/UserReport/Models/UserReportUser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public class UserReportUser: NSObject {
@objc private func getAdvertisingId() -> String {
var advertisingId: String = ""

if Bundle.main.object(forInfoDictionaryKey: "NSUserTrackingUsageDescription") == nil {
return advertisingId
}

if UserReport.shared?.anonymousTracking == true {
return advertisingId
}
Expand Down

0 comments on commit fd6aa16

Please sign in to comment.