Skip to content

Commit

Permalink
fix(app-check): fix platform guard for AppAttest to match upstream
Browse files Browse the repository at this point in the history
macOS platform guard was missing, one method was missing all non-iOS guards
  • Loading branch information
mikehardy committed Nov 7, 2024
1 parent 3691bd0 commit 30a79a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/app-check/ios/RNFBAppCheck/RNFBAppCheckProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ - (void)configure:(FIRApp *)app
}

if ([providerName isEqualToString:@"appAttest"]) {
if (@available(iOS 14.0, macCatalyst 14.0, tvOS 15.0, watchOS 9.0, *)) {
if (@available(iOS 14.0, macOS 11.0, macCatalyst 14.0, tvOS 15.0, watchOS 9.0, *)) {
self.delegateProvider = [[FIRAppAttestProvider alloc] initWithApp:app];
} else {
// This is not a valid configuration.
DLog(@"AppAttest unavailable: it requires iOS14+, macCatalyst14+ or tvOS15+. Installing "
DLog(@"AppAttest unavailable: it requires iOS14+, macOS 11+, macCatalyst14+ or tvOS15+. Installing "
@"debug provider to guarantee invalid tokens in this invalid configuration.");
self.delegateProvider = [[FIRAppCheckDebugProvider alloc] initWithApp:app];
}
}

if ([providerName isEqualToString:@"appAttestWithDeviceCheckFallback"]) {
if (@available(iOS 14.0, *)) {
if (@available(iOS 14.0, macOS 11.0, macCatalyst 14.0, tvOS 15.0, watchOS 9.0, *)) {
self.delegateProvider = [[FIRAppAttestProvider alloc] initWithApp:app];
} else {
self.delegateProvider = [[FIRDeviceCheckProvider alloc] initWithApp:app];
Expand Down

0 comments on commit 30a79a4

Please sign in to comment.