diff --git a/README.md b/README.md index 442159688f0d..b35b71cb950e 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ that enable Flutter apps to use [Firebase](https://firebase.google.com/) service | Plugin | Version | Firebase feature | Source code | Web? | |---|---|---|---|---| -| [cloud_firestore][firestore_pub] | ![pub package][firestore_badge] | [Cloud Firestore][firestore_product] | [`cloud_firestore`][firestore_code] | | -| [cloud_functions][functions_pub] | ![pub package][functions_badge] | [Cloud Functions][functions_product] | [`cloud_functions`][functions_code] | | +| [cloud_firestore][firestore_pub] | ![pub package][firestore_badge] | [Cloud Firestore][firestore_product] | [`cloud_firestore`][firestore_code] | hummingbird | +| [cloud_functions][functions_pub] | ![pub package][functions_badge] | [Cloud Functions][functions_product] | [`cloud_functions`][functions_code] | hummingbird | | [firebase_admob][admob_pub] | ![pub package][admob_badge] | [Firebase AdMob][admob_product] | [`firebase_admob`][admob_code] | | | [firebase_analytics][analytics_pub] | ![pub package][analytics_badge] | [Firebase Analytics][analytics_product] | [`firebase_analytics`][analytics_code] | | | [firebase_auth][auth_pub] | ![pub package][auth_badge] | [Firebase Authentication][auth_product] | [`firebase_auth`][auth_code] | hummingbird | diff --git a/packages/cloud_firestore/cloud_firestore/CHANGELOG.md b/packages/cloud_firestore/cloud_firestore/CHANGELOG.md index 89d4f7cd8ca5..e0b8f7590e85 100644 --- a/packages/cloud_firestore/cloud_firestore/CHANGELOG.md +++ b/packages/cloud_firestore/cloud_firestore/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.13.2+1 + +* Add Web integration documentation to README. + ## 0.13.2 * Add web support by default. diff --git a/packages/cloud_firestore/cloud_firestore/README.md b/packages/cloud_firestore/cloud_firestore/README.md index 4fec33d2edaf..bdd86593ef09 100755 --- a/packages/cloud_firestore/cloud_firestore/README.md +++ b/packages/cloud_firestore/cloud_firestore/README.md @@ -10,16 +10,28 @@ For Flutter plugins for other Firebase products, see [README.md](https://github. To use this plugin: -1. Using the [Firebase Console](http://console.firebase.google.com/), add an Android app to your project: -Follow the assistant, download the generated google-services.json file and place it inside android/app. Next, -modify the android/build.gradle file and the android/app/build.gradle file to add the Google services plugin -as described by the Firebase assistant. Ensure that your `android/build.gradle` file contains the +1. Add `cloud_firestore` as a [dependency in your pubspec.yaml file](https://flutter.dev/docs/development/packages-and-plugins/using-packages). + +### Android + +1. Using the [Firebase Console](http://console.firebase.google.com/), add an Android app to your project. +2. Follow the assistant, and download the generated `google-services.json` file and place it inside `android/app`. +3. Modify the `android/build.gradle` file and the `android/app/build.gradle` file to add the Google services plugin as described by the Firebase assistant. Ensure that your `android/build.gradle` file contains the `maven.google.com` as [described here](https://firebase.google.com/docs/android/setup#add_the_sdk). -1. Using the [Firebase Console](http://console.firebase.google.com/), add an iOS app to your project: -Follow the assistant, download the generated GoogleService-Info.plist file, open ios/Runner.xcworkspace -with Xcode, and within Xcode place the file inside ios/Runner. Don't follow the steps named -"Add Firebase SDK" and "Add initialization code" in the Firebase assistant. -1. Add `cloud_firestore` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/). + +### iOS + +1. Using the [Firebase Console](http://console.firebase.google.com/), add an iOS app to your project. +2. Follow the assistant, download the generated `GoogleService-Info.plist` file. Do **NOT** follow the steps named _"Add Firebase SDK"_ and _"Add initialization code"_ in the Firebase assistant. +3. Open `ios/Runner.xcworkspace` with Xcode, and **within Xcode** place the `GoogleService-Info.plist` file inside `ios/Runner`. + +### Web + +In addition to the `cloud_firestore` dependency, you'll need to modify the `web/index.html` of your app following the Firebase setup instructions: + +* [Add Firebase to your JavaScript project](https://firebase.google.com/docs/web/setup#from-the-cdn). + +Read more in the [`cloud_firestore_web` README](https://github.com/FirebaseExtended/flutterfire/blob/master/packages/cloud_firestore/cloud_firestore_web/README.md). ## Usage diff --git a/packages/cloud_firestore/cloud_firestore/pubspec.yaml b/packages/cloud_firestore/cloud_firestore/pubspec.yaml index 739b306c5a08..0e5fa833a464 100755 --- a/packages/cloud_firestore/cloud_firestore/pubspec.yaml +++ b/packages/cloud_firestore/cloud_firestore/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Cloud Firestore, a cloud-hosted, noSQL database with live synchronization and offline support on Android and iOS. homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/cloud_firestore/cloud_firestore -version: 0.13.2 +version: 0.13.2+1 flutter: plugin: diff --git a/packages/cloud_firestore/cloud_firestore_web/CHANGELOG.md b/packages/cloud_firestore/cloud_firestore_web/CHANGELOG.md index b788d0ac1dc4..6beb6f03354f 100644 --- a/packages/cloud_firestore/cloud_firestore_web/CHANGELOG.md +++ b/packages/cloud_firestore/cloud_firestore_web/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.0+2 + +- Update documentation about this package being the endorsed platform for web. + ## 0.1.0+1 - Fix `fileName` prop in pubspec.yaml diff --git a/packages/cloud_firestore/cloud_firestore_web/README.md b/packages/cloud_firestore/cloud_firestore_web/README.md index b9d0e93f883d..4992491a3fc5 100644 --- a/packages/cloud_firestore/cloud_firestore_web/README.md +++ b/packages/cloud_firestore/cloud_firestore_web/README.md @@ -6,31 +6,24 @@ The web implementation of [`cloud_firestore`][1]. ### Import the package -To use this plugin in your Flutter app on the web, simply add it as a -dependency in your `pubspec.yaml` alongside the base `cloud_firestore` -plugin. +This package is the endorsed implementation of `cloud_firestore` for the web platform since version `0.13.2`, so it gets automatically added to your application by depending on `cloud_firestore: ^0.13.2`. -_(This is only temporary: in the future we hope to make this package -an "endorsed" implementation of `cloud_firestore`, so it will automatically -be included in your app when you run your Flutter app on the web.)_ - -Add this to your `pubspec.yaml`: +No further modifications to your `pubspec.yaml` should be required in a recent enough version of Flutter (`>=1.12.13+hotfix.4`): ```yaml ... dependencies: ... - cloud_firestore: ^0.13.1 - cloud_firestore_web: ^0.1.0 + cloud_firestore: ^0.13.2 ... ``` -### Updating `index.html` +### Update `index.html` Due to [this bug in dartdevc][2], you will need to manually add the Firebase JavaScript files to your `index.html` file. -In your app directory, edit `web/index.html` to add the line: +In your app directory, edit `web/index.html` to add the following: ```html @@ -38,15 +31,50 @@ In your app directory, edit `web/index.html` to add the line: + ``` -### Using the plugin +### Initialize Firebase + +If your app is using the "default" Firebase app _(this means that you're not doing any `package:firebase_core` initialization yourself)_, +you'll need to initialize it now, following 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 + + + + + + + + + +``` + +### Use the plugin -Once you have added the `cloud_firebase_web` dependency to your pubspec, -you can use `package:cloud_firebase` as normal. +Once you have modified your `web/index.html` file, you should be able to use `package:cloud_firestore` as normal. Refer to the [`cloud_firestore` documentation][1] for more details. -[1]: ../cloud_firestore +[1]: https://pub.dev/packages/cloud_firestore [2]: https://github.com/dart-lang/sdk/issues/33979 +[3]: https://firebase.google.com/docs/web/setup#add-sdks-initialize diff --git a/packages/cloud_firestore/cloud_firestore_web/pubspec.yaml b/packages/cloud_firestore/cloud_firestore_web/pubspec.yaml index c9fe38711793..8279a115c2f7 100644 --- a/packages/cloud_firestore/cloud_firestore_web/pubspec.yaml +++ b/packages/cloud_firestore/cloud_firestore_web/pubspec.yaml @@ -1,7 +1,7 @@ name: cloud_firestore_web description: The web implementation of cloud_firestore homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/cloud_firestore/cloud_firestore_web -version: 0.1.0+1 +version: 0.1.0+2 flutter: plugin: