Skip to content

Commit 0676853

Browse files
committed
Revert changes except doc comments
1 parent 88ad2d0 commit 0676853

File tree

6 files changed

+26
-16
lines changed

6 files changed

+26
-16
lines changed

FirebaseAppCheck/Sources/DeviceCheckProvider/DCDevice+FIRDeviceCheckTokenGenerator.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616

1717
#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckAvailability.h"
1818

19-
#if __has_include(<DeviceCheck/DeviceCheck.h>)
19+
#if FIR_DEVICE_CHECK_SUPPORTED_TARGETS
20+
2021
#import <DeviceCheck/DeviceCheck.h>
2122

2223
#import "FirebaseAppCheck/Sources/DeviceCheckProvider/FIRDeviceCheckTokenGenerator.h"
@@ -29,4 +30,4 @@ NS_ASSUME_NONNULL_BEGIN
2930

3031
NS_ASSUME_NONNULL_END
3132

32-
#endif // __has_include(<DeviceCheck/DeviceCheck.h>)
33+
#endif // FIR_DEVICE_CHECK_SUPPORTED_TARGETS

FirebaseAppCheck/Sources/DeviceCheckProvider/FIRDeviceCheckProvider.m

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@
1616

1717
#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckAvailability.h"
1818

19-
#import <Foundation/Foundation.h>
19+
#if FIR_DEVICE_CHECK_SUPPORTED_TARGETS
2020

21-
#if __has_include(<DeviceCheck/DeviceCheck.h>)
22-
#import <DeviceCheck/DeviceCheck.h>
23-
#endif
21+
#import <Foundation/Foundation.h>
2422

2523
#if __has_include(<FBLPromises/FBLPromises.h>)
2624
#import <FBLPromises/FBLPromises.h>
@@ -64,16 +62,7 @@ - (instancetype)initWithAPIService:(id<FIRDeviceCheckAPIServiceProtocol>)APIServ
6462
}
6563

6664
- (instancetype)initWithAPIService:(id<FIRDeviceCheckAPIServiceProtocol>)APIService {
67-
#if __has_include(<DeviceCheck/DeviceCheck.h>)
6865
return [self initWithAPIService:APIService deviceTokenGenerator:[DCDevice currentDevice]];
69-
#else
70-
NSException *exception = [NSException
71-
exceptionWithName:NSInternalInconsistencyException
72-
reason:@"Unreachable code segment. Please file a bug at "
73-
@"https://github.com/firebase/firebase-ios-sdk/issues/new/choose."
74-
userInfo:nil];
75-
@throw exception;
76-
#endif
7766
}
7867

7968
- (nullable instancetype)initWithApp:(FIRApp *)app {
@@ -134,3 +123,5 @@ - (void)getTokenWithCompletion:(void (^)(FIRAppCheckToken *_Nullable token,
134123
@end
135124

136125
NS_ASSUME_NONNULL_END
126+
127+
#endif // FIR_DEVICE_CHECK_SUPPORTED_TARGETS

FirebaseAppCheck/Sources/DeviceCheckProvider/FIRDeviceCheckProviderFactory.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17+
#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckAvailability.h"
18+
19+
#if FIR_DEVICE_CHECK_SUPPORTED_TARGETS
20+
1721
#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProviderFactory.h"
1822

1923
#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheck.h"
@@ -30,3 +34,5 @@ + (void)load {
3034
}
3135

3236
@end
37+
38+
#endif // FIR_DEVICE_CHECK_SUPPORTED_TARGETS

FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckAvailability.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020

2121
#pragma mark - DeviceCheck
2222

23+
// Targets where DeviceCheck framework is available to be used in preprocessor conditions.
24+
#define FIR_DEVICE_CHECK_SUPPORTED_TARGETS TARGET_OS_IOS || TARGET_OS_OSX || TARGET_OS_TV
25+
2326
// `DeviceCheckProvider` availability.
2427
#define FIR_DEVICE_CHECK_PROVIDER_AVAILABILITY \
2528
API_AVAILABLE(ios(11.0), macos(10.15), tvos(11.0)) API_UNAVAILABLE(watchos)

FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProvider.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#import "FIRAppCheckAvailability.h"
2020
#import "FIRAppCheckProvider.h"
2121

22+
#if FIR_DEVICE_CHECK_SUPPORTED_TARGETS
23+
2224
@class FIRApp;
2325
@protocol FIRDeviceCheckAPIServiceProtocol;
2426
@protocol FIRDeviceCheckTokenGenerator;
@@ -43,3 +45,5 @@ NS_SWIFT_NAME(DeviceCheckProvider)
4345
@end
4446

4547
NS_ASSUME_NONNULL_END
48+
49+
#endif // FIR_DEVICE_CHECK_SUPPORTED_TARGETS

FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProviderFactory.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17+
#import "FIRAppCheckAvailability.h"
18+
19+
#if FIR_DEVICE_CHECK_SUPPORTED_TARGETS
20+
1721
#import <Foundation/Foundation.h>
1822

19-
#import "FIRAppCheckAvailability.h"
2023
#import "FIRAppCheckProviderFactory.h"
2124

2225
NS_ASSUME_NONNULL_BEGIN
@@ -33,3 +36,5 @@ NS_SWIFT_NAME(DeviceCheckProviderFactory)
3336
@end
3437

3538
NS_ASSUME_NONNULL_END
39+
40+
#endif // FIR_DEVICE_CHECK_SUPPORTED_TARGETS

0 commit comments

Comments
 (0)