Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
5 changes: 5 additions & 0 deletions packages/firebase_auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.12.0+1

* Fixes iOS sign-in exceptions when `additionalUserInfo` is `nil` or has `nil` fields.
* Additional integration testing.

## 0.12.0

* Added new `AuthResult` and `AdditionalUserInfo` classes.
Expand Down
11 changes: 10 additions & 1 deletion packages/firebase_auth/example/test/firebase_auth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ void main() {
group('$FirebaseAuth', () {
final FirebaseAuth auth = FirebaseAuth.instance;

setUp(() async {
await auth.signOut();
});

test('signInAnonymously', () async {
final AuthResult result = await auth.signInAnonymously();
final FirebaseUser user = result.user;
Expand All @@ -24,7 +28,12 @@ void main() {
expect(additionalUserInfo.username, isNull);
expect(additionalUserInfo.isNewUser, isNotNull);
expect(additionalUserInfo.profile, isNull);
expect(additionalUserInfo.providerId, isNull);
// TODO(jackson): Fix behavior to be consistent across platforms
// https://github.com/firebase/firebase-ios-sdk/issues/3450
expect(
additionalUserInfo.providerId == null ||
additionalUserInfo.providerId == 'password',
isTrue);
});

test('isSignInWithEmailLink', () async {
Expand Down
9 changes: 5 additions & 4 deletions packages/firebase_auth/ios/Classes/FirebaseAuthPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,13 @@ - (void)sendResult:(FlutterResult)result
[self sendResult:result
forObject:@{
@"user" : (user != nil ? [self dictionaryFromUser:user] : nil),
@"additionalUserInfo" : @{
@"additionalUserInfo" : additionalUserInfo ? @{
@"isNewUser" : [NSNumber numberWithBool:additionalUserInfo.isNewUser],
@"username" : additionalUserInfo.username,
@"providerId" : additionalUserInfo.providerID,
@"profile" : additionalUserInfo.profile,
@"username" : additionalUserInfo.username ?: [NSNull null],
@"providerId" : additionalUserInfo.providerID ?: [NSNull null],
@"profile" : additionalUserInfo.profile ?: [NSNull null],
}
: [NSNull null],
}
error:error];
}
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_auth/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Flutter plugin for Firebase Auth, enabling Android and iOS
like Google, Facebook and Twitter.
author: Flutter Team <flutter-dev@googlegroups.com>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_auth
version: "0.12.0"
version: "0.12.0+1"

flutter:
plugin:
Expand Down