FIRAppCheckAvailability.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright 2021 Google LLC
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. // Availability conditions for different App Check SDK components.
  17. #import <TargetConditionals.h>
  18. #pragma mark - DeviceCheck
  19. // Targets where DeviceCheck framework is available to be used in preprocessor conditions.
  20. #define FIR_DEVICE_CHECK_SUPPORTED_TARGETS TARGET_OS_IOS || TARGET_OS_OSX || TARGET_OS_TV
  21. // `DeviceCheckProvider` availability.
  22. #define FIR_DEVICE_CHECK_PROVIDER_AVAILABILITY \
  23. API_AVAILABLE(ios(11.0), macos(10.15), tvos(11.0)) API_UNAVAILABLE(watchos)
  24. #pragma mark - App Attest
  25. // App Attest availability was extended to macOS and Mac Catalyst in Xcode 12.5.
  26. #if (defined(__IPHONE_14_5) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_5) || \
  27. (defined(__MAC_11_3) && __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_11_3) || \
  28. (defined(__TVOS_14_5) && __TV_OS_VERSION_MAX_ALLOWED >= __TVOS_14_5)
  29. // Targets where `DCAppAttestService` is available to be used in preprocessor conditions.
  30. #define FIR_APP_ATTEST_SUPPORTED_TARGETS TARGET_OS_IOS || TARGET_OS_OSX
  31. // `AppAttestProvider` availability annotations
  32. #define FIR_APP_ATTEST_PROVIDER_AVAILABILITY \
  33. API_AVAILABLE(macos(11.0), ios(14.0)) API_UNAVAILABLE(tvos, watchos)
  34. #else // (defined(__IPHONE_14_5) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_5) || \
  35. (defined(__MAC_11_3) && __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_11_3) || \
  36. (defined(__TVOS_14_5) && __TV_OS_VERSION_MAX_ALLOWED >= __TVOS_14_5)
  37. // Targets where `DCAppAttestService` is available to be used in preprocessor conditions.
  38. #define FIR_APP_ATTEST_SUPPORTED_TARGETS TARGET_OS_IOS && !TARGET_OS_MACCATALYST
  39. // `AppAttestProvider` availability annotations
  40. #define FIR_APP_ATTEST_PROVIDER_AVAILABILITY \
  41. API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(macos, tvos, watchos)
  42. #endif // (defined(__IPHONE_14_5) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_5) || \
  43. (defined(__MAC_11_3) && __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_11_3) || \
  44. (defined(__TVOS_14_5) && __TV_OS_VERSION_MAX_ALLOWED >= __TVOS_14_5)