Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[firebase_core_web] Add documentation for how to initialize the default app #1545

Merged
merged 1 commit into from
Dec 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>
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