Skip to content

Commit 000799f

Browse files
author
UrsKahmann
committed
Disabling distribution features if os is macOS
1 parent c56ddf3 commit 000799f

2 files changed

Lines changed: 8 additions & 164 deletions

File tree

AppCenter/AppCenterSDK+HiDrive.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
import Foundation
1010
import AppCenter
1111
import AppCenterCrashes
12+
#if !os(macOS)
1213
import AppCenterDistribute
14+
#endif
1315
import SMFLogger
1416

1517

@@ -56,13 +58,18 @@ class AppCenterSDK: NSObject {
5658

5759
self.delegate = AppCenterSDKDelegate(isLogUploadEnabled: configuration.isLogUploadEnabled)
5860

61+
#if !os(macOS)
5962
let services = (configuration.isDistributionEnabled == true) ? [MSCrashes.self, MSDistribute.self] : [MSCrashes.self]
63+
#else
64+
let services = [MSCrashes.self]
65+
#endif
6066

6167
MSAppCenter.start(configuration.appSecret, withServices: services)
6268
MSCrashes.setEnabled(configuration.isCrashReportEnabled)
6369
MSCrashes.setDelegate(self.delegate)
6470
}
6571

72+
#if !os(macOS)
6673
/// Returns True, if and only if the Service got started and is enabled.
6774
static var isDistributionEnabled: Bool {
6875
return MSDistribute.isEnabled()
@@ -81,6 +88,7 @@ class AppCenterSDK: NSObject {
8188
static func enableDistribution(enabled: Bool = true) {
8289
MSDistribute.setEnabled(enabled)
8390
}
91+
#endif
8492

8593
/// Returns True, if and only if Crash Reporting is enabled.
8694
static var isCrashReportingEnabled: Bool {

AppCenter/AppCenterSDK+Mac.swift

Lines changed: 0 additions & 164 deletions
This file was deleted.

0 commit comments

Comments
 (0)