Skip to content

Commit

Permalink
Update all dependencies. Bump iOS deployment target to 9.0 (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
bizz84 committed Oct 17, 2019
1 parent 3521329 commit 1022b26
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 30 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,7 @@

- Add `AuthWidgetBuilder` above `MaterialApp` ([#39](https://github.com/bizz84/firebase_auth_demo_flutter/pull/39), fixes [#32](https://github.com/bizz84/firebase_auth_demo_flutter/issues/32))
- Only update loading state `ValueNotifier` when authentication calls fail ([#41](https://github.com/bizz84/firebase_auth_demo_flutter/pull/41))
- Update dependencies

# 0.0.8

Expand Down
2 changes: 1 addition & 1 deletion ios/Podfile
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
platform :ios, '9.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
11 changes: 3 additions & 8 deletions ios/Runner.xcodeproj/project.pbxproj
Expand Up @@ -238,15 +238,11 @@
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh",
"${PODS_ROOT}/GoogleSignIn/Resources/GoogleSignIn.bundle",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
);
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleSignIn.bundle",
);
Expand Down Expand Up @@ -296,8 +292,6 @@
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Bolts/Bolts.framework",
Expand All @@ -312,8 +306,6 @@
"${BUILT_PRODUCTS_DIR}/package_info/package_info.framework",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
);
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Bolts.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBSDKCoreKit.framework",
Expand Down Expand Up @@ -443,6 +435,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -576,6 +569,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -609,6 +603,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
Expand Down
34 changes: 23 additions & 11 deletions lib/services/firebase_auth_service.dart
Expand Up @@ -33,16 +33,19 @@ class FirebaseAuthService implements AuthService {

@override
Future<User> signInWithEmailAndPassword(String email, String password) async {
final AuthResult authResult = await _firebaseAuth.signInWithCredential(EmailAuthProvider.getCredential(
final AuthResult authResult = await _firebaseAuth
.signInWithCredential(EmailAuthProvider.getCredential(
email: email,
password: password,
));
return _userFromFirebase(authResult.user);
}

@override
Future<User> createUserWithEmailAndPassword(String email, String password) async {
final AuthResult authResult = await _firebaseAuth.createUserWithEmailAndPassword(email: email, password: password);
Future<User> createUserWithEmailAndPassword(
String email, String password) async {
final AuthResult authResult = await _firebaseAuth
.createUserWithEmailAndPassword(email: email, password: password);
return _userFromFirebase(authResult.user);
}

Expand All @@ -53,7 +56,8 @@ class FirebaseAuthService implements AuthService {

@override
Future<User> signInWithEmailAndLink({String email, String link}) async {
final AuthResult authResult = await _firebaseAuth.signInWithEmailAndLink(email: email, link: link);
final AuthResult authResult =
await _firebaseAuth.signInWithEmailAndLink(email: email, link: link);
return _userFromFirebase(authResult.user);
}

Expand Down Expand Up @@ -89,32 +93,40 @@ class FirebaseAuthService implements AuthService {
final GoogleSignInAccount googleUser = await googleSignIn.signIn();

if (googleUser != null) {
final GoogleSignInAuthentication googleAuth = await googleUser.authentication;
final GoogleSignInAuthentication googleAuth =
await googleUser.authentication;
if (googleAuth.accessToken != null && googleAuth.idToken != null) {
final AuthResult authResult = await _firebaseAuth.signInWithCredential(GoogleAuthProvider.getCredential(
final AuthResult authResult = await _firebaseAuth
.signInWithCredential(GoogleAuthProvider.getCredential(
idToken: googleAuth.idToken,
accessToken: googleAuth.accessToken,
));
return _userFromFirebase(authResult.user);
} else {
throw PlatformException(code: 'ERROR_MISSING_GOOGLE_AUTH_TOKEN', message: 'Missing Google Auth Token');
throw PlatformException(
code: 'ERROR_MISSING_GOOGLE_AUTH_TOKEN',
message: 'Missing Google Auth Token');
}
} else {
throw PlatformException(code: 'ERROR_ABORTED_BY_USER', message: 'Sign in aborted by user');
throw PlatformException(
code: 'ERROR_ABORTED_BY_USER', message: 'Sign in aborted by user');
}
}

@override
Future<User> signInWithFacebook() async {
final FacebookLogin facebookLogin = FacebookLogin();
final FacebookLoginResult result = await facebookLogin.logInWithReadPermissions(<String>['public_profile']);
final FacebookLoginResult result = await facebookLogin
.logInWithReadPermissions(<String>['public_profile']);
if (result.accessToken != null) {
final AuthResult authResult = await _firebaseAuth.signInWithCredential(
FacebookAuthProvider.getCredential(accessToken: result.accessToken.token),
FacebookAuthProvider.getCredential(
accessToken: result.accessToken.token),
);
return _userFromFirebase(authResult.user);
} else {
throw PlatformException(code: 'ERROR_ABORTED_BY_USER', message: 'Sign in aborted by user');
throw PlatformException(
code: 'ERROR_ABORTED_BY_USER', message: 'Sign in aborted by user');
}
}

Expand Down
21 changes: 11 additions & 10 deletions pubspec.yaml
Expand Up @@ -17,15 +17,16 @@ environment:
sdk: ">=2.2.2 <3.0.0"

dependencies:
random_string: 0.0.2
firebase_auth: 0.14.0
google_sign_in: 4.0.2
flutter_facebook_login: 2.0.1
provider: 3.0.0
firebase_dynamic_links: 0.5.0
rxdart: 0.22.1
flutter_secure_storage: 3.2.1+1
package_info: 0.4.0+6
random_string: ^1.1.0
firebase_auth: ^0.14.0+5
google_sign_in: ^4.0.7
# Sticking to 2.0.1 as version 3.0 generates compile errors for me on iOS
flutter_facebook_login: ^2.0.1
provider: ^3.1.0
firebase_dynamic_links: ^0.5.0+1
rxdart: ^0.22.3
flutter_secure_storage: ^3.3.1+1
package_info: ^0.4.0+6
flutter:
sdk: flutter

Expand All @@ -36,7 +37,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
mockito: 4.0.0
mockito: ^4.1.1
flutter_driver:
sdk: flutter
test: any
Expand Down

0 comments on commit 1022b26

Please sign in to comment.