Skip to content

Commit

Permalink
style(lint): yarn lint:android && yarn lint:ios:fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehardy committed Nov 27, 2023
1 parent c2c7955 commit 21e872d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,11 @@ public void getLimitedUseToken(String appName, Promise promise) {
FirebaseApp firebaseApp = FirebaseApp.getInstance(appName);

Check warning on line 212 in packages/app-check/android/src/main/java/io/invertase/firebase/appcheck/ReactNativeFirebaseAppCheckModule.java

View check run for this annotation

Codecov / codecov/patch

packages/app-check/android/src/main/java/io/invertase/firebase/appcheck/ReactNativeFirebaseAppCheckModule.java#L211-L212

Added lines #L211 - L212 were not covered by tests

Tasks.call(
getExecutor(),
() -> {
return Tasks.await(FirebaseAppCheck.getInstance(firebaseApp).getLimitedUseAppCheckToken());
})
getExecutor(),

Check warning on line 215 in packages/app-check/android/src/main/java/io/invertase/firebase/appcheck/ReactNativeFirebaseAppCheckModule.java

View check run for this annotation

Codecov / codecov/patch

packages/app-check/android/src/main/java/io/invertase/firebase/appcheck/ReactNativeFirebaseAppCheckModule.java#L214-L215

Added lines #L214 - L215 were not covered by tests
() -> {
return Tasks.await(
FirebaseAppCheck.getInstance(firebaseApp).getLimitedUseAppCheckToken());

Check warning on line 218 in packages/app-check/android/src/main/java/io/invertase/firebase/appcheck/ReactNativeFirebaseAppCheckModule.java

View check run for this annotation

Codecov / codecov/patch

packages/app-check/android/src/main/java/io/invertase/firebase/appcheck/ReactNativeFirebaseAppCheckModule.java#L217-L218

Added lines #L217 - L218 were not covered by tests
})
.addOnCompleteListener(
getExecutor(),

Check warning on line 221 in packages/app-check/android/src/main/java/io/invertase/firebase/appcheck/ReactNativeFirebaseAppCheckModule.java

View check run for this annotation

Codecov / codecov/patch

packages/app-check/android/src/main/java/io/invertase/firebase/appcheck/ReactNativeFirebaseAppCheckModule.java#L220-L221

Added lines #L220 - L221 were not covered by tests
(task) -> {
Expand Down
52 changes: 26 additions & 26 deletions packages/app-check/ios/RNFBAppCheck/RNFBAppCheckModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -140,32 +140,32 @@ + (instancetype)sharedInstance {
: (RCTPromiseRejectBlock)reject) {
FIRAppCheck *appCheck = [FIRAppCheck appCheckWithApp:firebaseApp];
DLog(@"appName %@", firebaseApp.name);
[appCheck
limitedUseTokenWithCompletion:^(FIRAppCheckToken *_Nullable token, NSError *_Nullable error) {
if (error != nil) {
// Handle any errors if the token was not retrieved.
DLog(@"RNFBAppCheck - getLimitedUseToken - Unable to retrieve App Check token: %@", error);
[RNFBSharedUtils rejectPromiseWithUserInfo:reject
userInfo:(NSMutableDictionary *)@{
@"code" : @"token-error",
@"message" : [error localizedDescription],
}];
return;
}
if (token == nil) {
DLog(@"RNFBAppCheck - getLimitedUseToken - Unable to retrieve App Check token.");
[RNFBSharedUtils rejectPromiseWithUserInfo:reject
userInfo:(NSMutableDictionary *)@{
@"code" : @"token-null",
@"message" : @"no token fetched",
}];
return;
}

NSMutableDictionary *tokenResultDictionary = [NSMutableDictionary new];
tokenResultDictionary[@"token"] = token.token;
resolve(tokenResultDictionary);
}];
[appCheck limitedUseTokenWithCompletion:^(FIRAppCheckToken *_Nullable token,
NSError *_Nullable error) {
if (error != nil) {
// Handle any errors if the token was not retrieved.
DLog(@"RNFBAppCheck - getLimitedUseToken - Unable to retrieve App Check token: %@", error);
[RNFBSharedUtils rejectPromiseWithUserInfo:reject
userInfo:(NSMutableDictionary *)@{
@"code" : @"token-error",
@"message" : [error localizedDescription],
}];
return;
}
if (token == nil) {
DLog(@"RNFBAppCheck - getLimitedUseToken - Unable to retrieve App Check token.");
[RNFBSharedUtils rejectPromiseWithUserInfo:reject
userInfo:(NSMutableDictionary *)@{
@"code" : @"token-null",
@"message" : @"no token fetched",
}];
return;
}

NSMutableDictionary *tokenResultDictionary = [NSMutableDictionary new];
tokenResultDictionary[@"token"] = token.token;
resolve(tokenResultDictionary);
}];
}

@end
4 changes: 2 additions & 2 deletions packages/app-check/ios/RNFBAppCheck/RNFBAppCheckProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ - (void)getTokenWithCompletion:(nonnull void (^)(FIRAppCheckToken *_Nullable,
[self.delegateProvider getTokenWithCompletion:handler];
}

- (void)getLimitedUseTokenWithCompletion:
(nonnull void (^)(FIRAppCheckToken *_Nullable, NSError *_Nullable))handler {
- (void)getLimitedUseTokenWithCompletion:(nonnull void (^)(FIRAppCheckToken *_Nullable,
NSError *_Nullable))handler {
DLog(@"proxying getLimitedUseTokenWithCompletion to delegateProvider...");
[self.delegateProvider getLimitedUseTokenWithCompletion:handler];
}
Expand Down

0 comments on commit 21e872d

Please sign in to comment.