Skip to content

Commit

Permalink
Merge pull request #131 from mikakruschel/master
Browse files Browse the repository at this point in the history
Fix macCatalyst support
  • Loading branch information
AvdLee authored Aug 24, 2022
2 parents 71886fb + b9ae403 commit 4e92cbb
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 4e92cbb

Please sign in to comment.