Skip to content

Commit

Permalink
chore: fix format and analyze
Browse files Browse the repository at this point in the history
  • Loading branch information
pr-Mais committed Dec 3, 2021
1 parent 997b69d commit 523a121
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -727,29 +727,29 @@ - (void)userUnlink:(id)arguments withMethodCallResult:(FLTFirebaseMethodCallResu
}

[currentUser
unlinkFromProvider:arguments[kArgumentProviderId]
completion:^(FIRUser *_Nullable user, NSError *_Nullable error) {
if (error != nil) {
result.error(nil, nil, nil, error);
} else {
[auth.currentUser reloadWithCompletion:^(NSError *_Nullable reloadError) {
if (reloadError != nil) {
result.error(nil, nil, nil, reloadError);
} else {
// Note: On other SDKs `unlinkFromProvider` returns an AuthResult
// instance, whereas the iOS SDK currently does not, so we manualy
// construct a Dart representation of one here.
result.success(@{
@"additionalUserInfo" : [NSNull null],
@"authCredential" : [NSNull null],
@"user" : auth.currentUser
? [FLTFirebaseAuthPlugin getNSDictionaryFromUser:auth.currentUser]
: [NSNull null],
});
}
}];
}
}];
unlinkFromProvider:arguments[kArgumentProviderId]
completion:^(FIRUser *_Nullable user, NSError *_Nullable error) {
if (error != nil) {
result.error(nil, nil, nil, error);
} else {
[auth.currentUser reloadWithCompletion:^(NSError *_Nullable reloadError) {
if (reloadError != nil) {
result.error(nil, nil, nil, reloadError);
} else {
// Note: On other SDKs `unlinkFromProvider` returns an AuthResult
// instance, whereas the iOS SDK currently does not, so we manualy
// construct a Dart representation of one here.
result.success(@{
@"additionalUserInfo" : [NSNull null],
@"authCredential" : [NSNull null],
@"user" : auth.currentUser
? [FLTFirebaseAuthPlugin getNSDictionaryFromUser:auth.currentUser]
: [NSNull null],
});
}
}];
}
}];
}

- (void)userUpdateEmail:(id)arguments withMethodCallResult:(FLTFirebaseMethodCallResult *)result {
Expand Down Expand Up @@ -819,20 +819,20 @@ - (void)userUpdatePhoneNumber:(id)arguments
}

[currentUser
updatePhoneNumberCredential:(FIRPhoneAuthCredential *)credential
completion:^(NSError *_Nullable error) {
if (error != nil) {
result.error(nil, nil, nil, error);
} else {
[currentUser reloadWithCompletion:^(NSError *_Nullable reloadError) {
if (reloadError != nil) {
result.error(nil, nil, nil, reloadError);
} else {
result.success(auth.currentUser);
}
}];
}
}];
updatePhoneNumberCredential:(FIRPhoneAuthCredential *)credential
completion:^(NSError *_Nullable error) {
if (error != nil) {
result.error(nil, nil, nil, error);
} else {
[currentUser reloadWithCompletion:^(NSError *_Nullable reloadError) {
if (reloadError != nil) {
result.error(nil, nil, nil, reloadError);
} else {
result.success(auth.currentUser);
}
}];
}
}];
#else
NSLog(@"Updating a users phone number via Firebase Authentication is only supported on the iOS "
@"platform.");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.flutter.plugins.firebase.installations.firebase_installations;


import com.google.firebase.installations.FirebaseInstallations;
import com.google.firebase.installations.internal.FidListener;
import io.flutter.plugin.common.EventChannel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// ignore_for_file: require_trailing_commas
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
Expand All @@ -24,9 +23,13 @@ void main() {
setUpAll(() async {
await Firebase.initializeApp();
installations = FirebaseInstallations.instance;
when(mockInstallations.delegateFor(
app: anyNamed('app'),
)).thenAnswer((_) => mockInstallations);
when(
mockInstallations.delegateFor(
app: anyNamed('app'),
),
).thenAnswer(
(_) => mockInstallations,
);
when(mockInstallations.getId()).thenAnswer(
(_) => Future.value('some-id'),
);
Expand All @@ -38,7 +41,7 @@ void main() {
});
test('getAuthToken', () async {
await installations.getToken();
verify(mockInstallations.getToken(false));
verify(mockInstallations.getToken());
});
test('delete', () async {
await installations.delete();
Expand Down Expand Up @@ -107,6 +110,7 @@ class MockFirebaseInstallations extends Mock
}

@override
// ignore: type_annotate_public_apis
Future<String> getToken([forceRefresh = false]) {
return super.noSuchMethod(
Invocation.method(#getToken, [forceRefresh]),
Expand Down

0 comments on commit 523a121

Please sign in to comment.