Skip to content

Commit fd6aa16

Browse files
authored
Merge pull request #25 from audienceproject/feature/fix-crash-if-no-tracking-param
fix app crash if user did not set NSUserTrackingUsageDescription param
2 parents bb63dd8 + 553edb9 commit fd6aa16

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

UserReport/UserReport/Models/UserReportUser.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ public class UserReportUser: NSObject {
4141
@objc private func getAdvertisingId() -> String {
4242
var advertisingId: String = ""
4343

44+
if Bundle.main.object(forInfoDictionaryKey: "NSUserTrackingUsageDescription") == nil {
45+
return advertisingId
46+
}
47+
4448
if UserReport.shared?.anonymousTracking == true {
4549
return advertisingId
4650
}

0 commit comments

Comments
 (0)