Skip to content

Commit

Permalink
Add documentation for how to initialize the default app (flutter#1545)
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry Terkelsen committed Dec 4, 2019
1 parent 66307da commit e4a95e8
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/firebase_core/firebase_core_web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.1.0+2

* Add documentation for initializing the default app.

## 0.1.0+1

* Use `package:firebase` for firebase functionality.
Expand Down
26 changes: 25 additions & 1 deletion packages/firebase_core/firebase_core_web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies:
### Updating `index.html`

Due to [this bug in dartdevc][2], you will need to manually add the Firebase
JavaScript file to you `index.html` file.
JavaScript file to your `index.html` file.

In your app directory, edit `web/index.html` to add the line:

Expand All @@ -42,10 +42,34 @@ In your app directory, edit `web/index.html` to add the line:
</html>
```

### Initialize Firebase

If you want to initialize the default app, follow the steps in the
[Firebase Web Setup][3] docs. Specifically, you'll want to add the
following lines to your `web/index.html` file:

```html
<body>
<!-- Previously loaded Firebase SDKs -->

<script>
// TODO: Replace the following with your app's Firebase project configuration
var firebaseConfig = {
// ...
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
</script>
<script src="main.dart.js"></script>
</body>
```

### Using the plugin

Once you have added the `firebase_core_web` dependency to your pubspec,
you can use `package:firebase_core` as normal.

[1]: ../firebase_core/firebase_core
[2]: https://github.com/dart-lang/sdk/issues/33979
[3]: https://firebase.google.com/docs/web/setup#add-sdks-initialize
2 changes: 1 addition & 1 deletion packages/firebase_core/firebase_core_web/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: firebase_core_web
description: The web implementation of firebase_core
author: Flutter Team <flutter-dev@googlegroups.com>
homepage: https://github.com/FirebaseExtended/flutterfire/packages/firebase_core/firebase_core_web
version: 0.1.0+1
version: 0.1.0+2

flutter:
plugin:
Expand Down

0 comments on commit e4a95e8

Please sign in to comment.