Skip to content

Commit

Permalink
[firebase_auth] Endorse web implementation (firebase#1601)
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry Terkelsen authored Dec 11, 2019
1 parent a8873ed commit a4779ef
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 3 deletions.
5 changes: 5 additions & 0 deletions packages/firebase_auth/firebase_auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.15.2

* Add web support by default.
* Require Flutter SDK 1.12.13+hotfix.4 or later.

## 0.15.1+1

* Remove the deprecated `author:` field from pubspec.yaml
Expand Down
10 changes: 9 additions & 1 deletion packages/firebase_auth/firebase_auth/example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@ Demonstrates how to use the firebase_auth plugin.
verification code.
1. Click the `Test signInWithPhoneNumber` button.
1. Signed in user's details are displayed in the UI.


## Running on Web

Make sure you run the example app on port 5000, since `localhost:5000` is
whitelisted for Google authentication. To do so, run:

```
flutter run -d web-server --web-port 5000
```

## Getting Started

Expand Down
27 changes: 27 additions & 0 deletions packages/firebase_auth/firebase_auth/example/web/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="google-signin-client_id" content="159623150305-q05bbbtsutr02abhips3suj7hujfk4bg.apps.googleusercontent.com" />
<title>Firebase Auth Example</title>
</head>
<body>
<script src="https://www.gstatic.com/firebasejs/7.5.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.5.0/firebase-auth.js"></script>
<script>
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "AIzaSyBMaLre-rTS-P_J7LlcHRfrKoL0WemP0kw",
authDomain: "flutter-firebase-plugins.firebaseapp.com",
databaseURL: "https://flutter-firebase-plugins.firebaseio.com",
projectId: "flutter-firebase-plugins",
storageBucket: "flutter-firebase-plugins.appspot.com",
messagingSenderId: "159623150305",
appId: "1:159623150305:web:b2b676fa6ead437bbf95a0"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
</script>
<script src="main.dart.js" type="application/javascript"></script>
</body>
</html>
12 changes: 10 additions & 2 deletions packages/firebase_auth/firebase_auth/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for Firebase Auth, enabling Android and iOS
authentication using passwords, phone numbers and identity providers
like Google, Facebook and Twitter.
homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_auth/firebase_auth
version: 0.15.1+1
version: 0.15.2

flutter:
plugin:
Expand All @@ -13,11 +13,19 @@ flutter:
pluginClass: FirebaseAuthPlugin
ios:
pluginClass: FLTFirebaseAuthPlugin
web:
default_package: firebase_auth_web

dependencies:
meta: ^1.0.4
firebase_core: ^0.4.0
firebase_auth_platform_interface: ^1.0.0
# The design on https://flutter.dev/go/federated-plugins was to leave
# this constraint as "any". We cannot do it right now as it fails pub publish
# validation, so we set a ^ constraint.
# TODO(amirh): Revisit this (either update this part in the design or the pub tool).
# https://github.com/flutter/flutter/issues/46264
firebase_auth_web: ^0.1.1

flutter:
sdk: flutter
Expand All @@ -36,4 +44,4 @@ dev_dependencies:

environment:
sdk: ">=2.0.0-dev.28.0 <3.0.0"
flutter: ">=1.10.0 <2.0.0"
flutter: ">=1.12.13+hotfix.4 <2.0.0"

0 comments on commit a4779ef

Please sign in to comment.