Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// SPDX-License-Identifier: Apache-2.0
//

import AmplifyAvailability
import Foundation

struct ASFAppInfo: ASFAppInfoBehavior {
Expand All @@ -16,9 +17,9 @@ struct ASFAppInfo: ASFAppInfoBehavior {
var targetSDK: String {
var targetSDK: String = ""
#if os(iOS) || os(watchOS) || os(tvOS)
targetSDK = "\(__IPHONE_OS_VERSION_MIN_REQUIRED)"
targetSDK = "\(getIOSVersionMinRequired())"
#elseif os(macOS)
targetSDK = "\(__MAC_OS_X_VERSION_MIN_REQUIRED)"
targetSDK = "\(getMACOSXVersionMinRequired())"
#else
targetSDK = "Unknown"
#endif
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// Copyright Amazon.com Inc. or its affiliates.
// All Rights Reserved.
//
// SPDX-License-Identifier: Apache-2.0
//

#include "include/AmplifyAvailability.h"
#include <Availability.h>

#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV
int getIOSVersionMinRequired(void) {
return __IPHONE_OS_VERSION_MIN_REQUIRED;
}
#endif

#if TARGET_OS_OSX
int getMACOSXVersionMinRequired(void) {
return __MAC_OS_X_VERSION_MIN_REQUIRED;
}
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// Copyright Amazon.com Inc. or its affiliates.
// All Rights Reserved.
//
// SPDX-License-Identifier: Apache-2.0
//

#ifndef AmplifyAvailability_h
#define AmplifyAvailability_h

#include <TargetConditionals.h>

#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV
int getIOSVersionMinRequired(void);
#endif

#if TARGET_OS_OSX
int getMACOSXVersionMinRequired(void);
#endif

#endif /* AmplifyAvailability_h */
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module AmplifyAvailability {
header "include/AmplifyAvailability.h"
export *
}
6 changes: 6 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ let authTargets: [Target] = [
name: "AWSCognitoAuthPlugin",
dependencies: [
.target(name: "Amplify"),
.target(name: "AmplifyAvailability"),
.target(name: "AmplifySRP"),
.target(name: "AWSPluginsCore"),
.target(name: "InternalAmplifyCredentials"),
Expand All @@ -191,6 +192,11 @@ let authTargets: [Target] = [
.copy("Resources/PrivacyInfo.xcprivacy")
]
),
.target(
name: "AmplifyAvailability",
path: "AmplifyPlugins/Auth/Sources/AmplifyAvailability",
publicHeadersPath: "include"
),
.target(
name: "libtommathAmplify",
path: "AmplifyPlugins/Auth/Sources/libtommath",
Expand Down
Loading