FIRAppCheckAvailability.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 <Foundation/Foundation.h>
  18. #import <TargetConditionals.h>
  19. #pragma mark - DeviceCheck
  20. // DeviceCheck availability was extended to watchOS in Xcode 14.
  21. #if defined(__WATCHOS_9_0) && __WATCH_OS_VERSION_MAX_ALLOWED >= __WATCHOS_9_0
  22. // Targets where DeviceCheck framework is available to be used in preprocessor conditions.
  23. #define FIR_DEVICE_CHECK_SUPPORTED_TARGETS \
  24. TARGET_OS_IOS || TARGET_OS_OSX || TARGET_OS_TV || TARGET_OS_WATCH
  25. // `DeviceCheckProvider` availability.
  26. #define FIR_DEVICE_CHECK_PROVIDER_AVAILABILITY \
  27. API_AVAILABLE(ios(11.0), macos(10.15), tvos(11.0), watchos(9.0))
  28. // TODO(ncooke3): Remove `#else` clause when Xcode 14 is the minimum supported Xcode.
  29. #else // defined(__WATCHOS_9_0) && __WATCH_OS_VERSION_MAX_ALLOWED >= __WATCHOS_9_0
  30. // Targets where DeviceCheck framework is available to be used in preprocessor conditions.
  31. #define FIR_DEVICE_CHECK_SUPPORTED_TARGETS TARGET_OS_IOS || TARGET_OS_OSX || TARGET_OS_TV
  32. // `DeviceCheckProvider` availability.
  33. #define FIR_DEVICE_CHECK_PROVIDER_AVAILABILITY \
  34. API_AVAILABLE(ios(11.0), macos(10.15), tvos(11.0)) API_UNAVAILABLE(watchos)
  35. #endif // defined(__WATCHOS_9_0) && __WATCH_OS_VERSION_MAX_ALLOWED >= __WATCHOS_9_0
  36. #pragma mark - App Attest
  37. #if defined(__WATCHOS_9_0) && __WATCH_OS_VERSION_MAX_ALLOWED >= __WATCHOS_9_0
  38. // Targets where `DCAppAttestService` is available to be used in preprocessor conditions.
  39. #define FIR_APP_ATTEST_SUPPORTED_TARGETS \
  40. TARGET_OS_IOS || TARGET_OS_OSX || TARGET_OS_TV || TARGET_OS_WATCH
  41. // `AppAttestProvider` availability annotations
  42. #define FIR_APP_ATTEST_PROVIDER_AVAILABILITY \
  43. API_AVAILABLE(macos(11.0), ios(14.0), tvos(15.0), watchos(9.0))
  44. // TODO(ncooke3): Remove `#else` clause when Xcode 14 is the minimum supported Xcode.
  45. #else // defined(__WATCHOS_9_0) && __WATCH_OS_VERSION_MAX_ALLOWED >= __WATCHOS_9_0
  46. // Targets where `DCAppAttestService` is available to be used in preprocessor conditions.
  47. #define FIR_APP_ATTEST_SUPPORTED_TARGETS TARGET_OS_IOS || TARGET_OS_OSX || TARGET_OS_TV
  48. // `AppAttestProvider` availability annotations
  49. #define FIR_APP_ATTEST_PROVIDER_AVAILABILITY \
  50. API_AVAILABLE(macos(11.0), ios(14.0), tvos(15.0)) API_UNAVAILABLE(watchos)
  51. #endif // defined(__WATCHOS_9_0) && __WATCH_OS_VERSION_MAX_ALLOWED >= __WATCHOS_9_0