Skip to content

Commit

Permalink
Revert changes except doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
morganchen12 committed Aug 4, 2021
1 parent 88ad2d0 commit 5d9b2b2
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

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

#if __has_include(<DeviceCheck/DeviceCheck.h>)
#if FIR_DEVICE_CHECK_SUPPORTED_TARGETS

#import <DeviceCheck/DeviceCheck.h>

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

NS_ASSUME_NONNULL_END

#endif // __has_include(<DeviceCheck/DeviceCheck.h>)
#endif // FIR_DEVICE_CHECK_SUPPORTED_TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@

#import <Foundation/Foundation.h>

#if __has_include(<DeviceCheck/DeviceCheck.h>)
#import <DeviceCheck/DeviceCheck.h>
#endif
#if FIR_DEVICE_CHECK_SUPPORTED_TARGETS

#if __has_include(<FBLPromises/FBLPromises.h>)
#import <FBLPromises/FBLPromises.h>
Expand Down Expand Up @@ -64,16 +62,7 @@ - (instancetype)initWithAPIService:(id<FIRDeviceCheckAPIServiceProtocol>)APIServ
}

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

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

NS_ASSUME_NONNULL_END

#endif // FIR_DEVICE_CHECK_SUPPORTED_TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
* limitations under the License.
*/

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

#if FIR_DEVICE_CHECK_SUPPORTED_TARGETS

#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProviderFactory.h"

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

@end

#endif // FIR_DEVICE_CHECK_SUPPORTED_TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

#pragma mark - DeviceCheck

// Targets where DeviceCheck framework is available to be used in preprocessor conditions.
#define FIR_DEVICE_CHECK_SUPPORTED_TARGETS TARGET_OS_IOS || TARGET_OS_OSX || TARGET_OS_TV

// `DeviceCheckProvider` availability.
#define FIR_DEVICE_CHECK_PROVIDER_AVAILABILITY \
API_AVAILABLE(ios(11.0), macos(10.15), tvos(11.0)) API_UNAVAILABLE(watchos)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#import "FIRAppCheckAvailability.h"
#import "FIRAppCheckProvider.h"

#if FIR_DEVICE_CHECK_SUPPORTED_TARGETS

@class FIRApp;
@protocol FIRDeviceCheckAPIServiceProtocol;
@protocol FIRDeviceCheckTokenGenerator;
Expand All @@ -43,3 +45,5 @@ NS_SWIFT_NAME(DeviceCheckProvider)
@end

NS_ASSUME_NONNULL_END

#endif // FIR_DEVICE_CHECK_SUPPORTED_TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@
* limitations under the License.
*/

#import "FIRAppCheckAvailability.h"

#if FIR_DEVICE_CHECK_SUPPORTED_TARGETS

#import <Foundation/Foundation.h>

#import "FIRAppCheckAvailability.h"
#import "FIRAppCheckProviderFactory.h"

NS_ASSUME_NONNULL_BEGIN
Expand All @@ -33,3 +36,5 @@ NS_SWIFT_NAME(DeviceCheckProviderFactory)
@end

NS_ASSUME_NONNULL_END

#endif // FIR_DEVICE_CHECK_SUPPORTED_TARGETS

0 comments on commit 5d9b2b2

Please sign in to comment.