Skip to content

Commit

Permalink
fix(app-check, ios): Xcode 14.3 compat bugfix
Browse files Browse the repository at this point in the history
The new version of Xcode enforces firebase-ios-sdk API `UNAVAILABLE`
directives (as it should!) and the initial implementation here was
incorrectly relying on unavailable things

Fixes #7014
  • Loading branch information
mikehardy committed Apr 1, 2023
1 parent f89dec5 commit c4bb807
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/app-check/ios/RNFBAppCheck/RNFBAppCheckProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ - (void)configure:(FIRApp *)app
// exists:
if (debugToken != nil) {
// We have a debug token, so just need to stuff it in the environment and it will hook up
char *key = "FIRAAppCheckDebugToken", *value = (char*)[debugToken UTF8String];
char *key = "FIRAAppCheckDebugToken", *value = (char *)[debugToken UTF8String];
int overwrite = 1;
setenv(key, value, overwrite);
}

self.delegateProvider = [[FIRAppCheckDebugProvider new] initWithApp:app];
self.delegateProvider = [[FIRAppCheckDebugProvider alloc] initWithApp:app];
}

if ([providerName isEqualToString:@"deviceCheck"]) {
self.delegateProvider = [[FIRDeviceCheckProvider new] initWithApp:app];
self.delegateProvider = [[FIRDeviceCheckProvider alloc] initWithApp:app];
}

if ([providerName isEqualToString:@"appAttest"]) {
Expand All @@ -61,7 +61,7 @@ - (void)configure:(FIRApp *)app
// This is not a valid configuration.
DLog(@"AppAttest unavailable: it requires iOS14+, macCatalyst14+ or tvOS15+. Installing "
@"debug provider to guarantee invalid tokens in this invalid configuration.");
self.delegateProvider = [[FIRAppCheckDebugProvider new] initWithApp:app];
self.delegateProvider = [[FIRAppCheckDebugProvider alloc] initWithApp:app];
}
}

Expand Down

1 comment on commit c4bb807

@vercel
Copy link

@vercel vercel bot commented on c4bb807 Apr 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.