Skip to content

Commit c26eebb

Browse files
committed
add ios check
1 parent 479cfb8 commit c26eebb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/AWSCognitoAuthPlugin+Configure.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import AWSClientRuntime
1616
@_spi(InternalHttpEngineProxy) import AWSPluginsCore
1717
import SmithyRetriesAPI
1818
import SmithyRetries
19-
#if canImport(UIKit)
19+
#if os(iOS) && canImport(UIKit)
2020
import UIKit
2121
#endif
2222

@@ -41,7 +41,7 @@ extension AWSCognitoAuthPlugin {
4141
AuthPluginErrorConstants.decodeConfigurationError.recoverySuggestion)
4242
}
4343

44-
#if canImport(UIKit)
44+
#if os(iOS) && canImport(UIKit)
4545
guard UIApplication.shared.isProtectedDataAvailable else {
4646
throw PluginError.pluginConfigurationError(
4747
AuthPluginErrorConstants.protectedDataUnavailableError.errorDescription,

AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Task/Protocols/AmplifyAuthTask.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import Foundation
88
import Amplify
99

10-
#if canImport(UIKit)
10+
#if os(iOS) && canImport(UIKit)
1111
import UIKit
1212
#endif
1313

@@ -34,7 +34,7 @@ extension AmplifyAuthTask where Self: DefaultLogger {
3434
get async throws {
3535
do {
3636
log.info("Starting execution for \(eventName)")
37-
#if canImport(UIKit)
37+
#if os(iOS) && canImport(UIKit)
3838
guard await UIApplication.shared.isProtectedDataAvailable else {
3939
throw AuthError.configuration(
4040
AuthPluginErrorConstants.protectedDataUnavailableError.errorDescription,

0 commit comments

Comments
 (0)