Skip to content

Commit

Permalink
Fix macCatalyst support
Browse files Browse the repository at this point in the history
  • Loading branch information
mikakruschel committed Aug 16, 2022
1 parent 71886fb commit b9ae403
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Sources/Reporters/AppSystemMetadataReporter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public struct AppSystemMetadataReporter: DiagnosticsReporting {
MetadataKey.deviceLanguage.rawValue: Locale.current.languageCode ?? "Unknown",
MetadataKey.appLanguage.rawValue: Locale.preferredLanguages[0]
]
#if os(iOS)
#if os(iOS) && !targetEnvironment(macCatalyst)
let cellularData = CTCellularData()
metadata[MetadataKey.cellularAllowed.rawValue] = "\(cellularData.restrictedState)"
#endif
Expand All @@ -86,7 +86,7 @@ public struct AppSystemMetadataReporter: DiagnosticsReporting {
}
}

#if os(iOS)
#if os(iOS) && !targetEnvironment(macCatalyst)
extension CTCellularDataRestrictedState: CustomStringConvertible {
public var description: String {
switch self {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Reporters/SmartInsightsReporter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public struct SmartInsightsReporter: DiagnosticsReporting {
DeviceStorageInsight(),
UpdateAvailableInsight()
]
#if os(iOS)
#if os(iOS) && !targetEnvironment(macCatalyst)
defaultInsights.append(CellularAllowedInsight())
#endif

Expand Down
2 changes: 1 addition & 1 deletion Sources/SmartInsights/CellularAllowedInsight.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation
import CoreTelephony

#if os(iOS)
#if os(iOS) && !targetEnvironment(macCatalyst)
/// Shows an insight on whether the user has enabled cellular data system-wide for this app.
struct CellularAllowedInsight: SmartInsightProviding {

Expand Down

0 comments on commit b9ae403

Please sign in to comment.