Skip to content

Commit

Permalink
[cloud_functions] Update example, README, depend on web plugin (flutt…
Browse files Browse the repository at this point in the history
…er#1909)

* Update example, add web plugin to cloud_functions dependencies

* Add web plugin section to pubspec

* Bump version for cloud_functions_web to pull in README changes

* Appease version checker
  • Loading branch information
sbeitzel authored Feb 4, 2020
1 parent 3372099 commit d39ad94
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 8 deletions.
5 changes: 5 additions & 0 deletions packages/cloud_functions/cloud_functions/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.4.1+9

* Depends on `cloud_functions_web` so that projects importing this plugin will get web support.
* Added web implementation to the example application.

## 0.4.1+8

* Fixes the `No implementation found for method CloudFunctions#call`
Expand Down
34 changes: 34 additions & 0 deletions packages/cloud_functions/cloud_functions/example/web/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!--
~ Copyright 2020 The Chromium Authors. All rights reserved.
~ Use of this source code is governed by a BSD-style license that can be
~ found in the LICENSE file.
-->

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Cloud Functions example app</title>
</head>
<body>
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/7.6.2/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.6.2/firebase-functions.js"></script>

<!-- Initialize Firebase -->
<script>
const firebaseConfig = {
apiKey: "AIzaSyBq6mcufFXfyqr79uELCiqM_O_1-G72PVU",
authDomain: "flutterfire-cd2f7.firebaseapp.com",
databaseURL: "https://flutterfire-cd2f7.firebaseio.com",
projectId: "flutterfire-cd2f7",
storageBucket: "flutterfire-cd2f7.appspot.com",
messagingSenderId: "297855924061",
appId: "1:297855924061:web:ccfb5cc13360119c",
};
// Initialize Firebase
let firebaseApp = firebase.initializeApp(firebaseConfig);
</script>
<script src="main.dart.js" type="application/javascript"></script>
</body>
</html>
5 changes: 4 additions & 1 deletion packages/cloud_functions/cloud_functions/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: cloud_functions
description: Flutter plugin for Cloud Functions.
version: 0.4.1+8
version: 0.4.1+9
homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/cloud_functions/cloud_functions

flutter:
Expand All @@ -11,13 +11,16 @@ flutter:
pluginClass: CloudFunctionsPlugin
ios:
pluginClass: CloudFunctionsPlugin
web:
default_package: cloud_functions_web

dependencies:
meta: ^1.1.6
flutter:
sdk: flutter
firebase_core: ^0.4.0
cloud_functions_platform_interface: ^1.0.0
cloud_functions_web: ^1.0.2

dev_dependencies:
flutter_test:
Expand Down
4 changes: 4 additions & 0 deletions packages/cloud_functions/cloud_functions_web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.3

Update README with real version numbers.

## 1.0.2

Delete Kotlin no-op plugin and replace with Java.
Expand Down
10 changes: 4 additions & 6 deletions packages/cloud_functions/cloud_functions_web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ The web implementation of [`cloud_functions`][1].

### Import the package

**TODO(sbeitzel) - update the versions here so that it's correct, once this package actually _is_ an endorsed implementation of `package:cloud_functions`**

This package is the endorsed implementation of `cloud_functions` for the web platform since version `0.0.1`, so it gets automatically added to your dependencies by depending on `cloud_functions: ^0.0.1`.
This package is the endorsed implementation of `cloud_functions` for the web platform since version `0.4.1+9`, so it gets automatically added to your dependencies by depending on `cloud_functions: ^0.4.1+9`.

No modifications to your `pubspec.yaml` should be required in a recent enough version of Flutter (`>=1.12.13+hotfix.4`):

```yaml
...
dependencies:
...
cloud_functions: ^0.0.1
cloud_functions: ^0.4.1+9
...
```

Expand Down Expand Up @@ -52,7 +50,7 @@ Specifically, you'll want to add the following lines to your `web/index.html` fi
<script>
// TODO: Replace the following with your app's Firebase project configuration.
// See: https://support.google.com/firebase/answer/7015592
var firebaseConfig = {
const firebaseConfig = {
apiKey: "...",
authDomain: "[YOUR_PROJECT].firebaseapp.com",
databaseURL: "https://[YOUR_PROJECT].firebaseio.com",
Expand All @@ -77,7 +75,7 @@ Once you have modified your `web/index.html` file you should be able to use `pac

#### Examples

* The `example` app in `package:cloud_functions` has an implementation of this instructions.
* The `example` app in `package:cloud_functions` has an implementation of these instructions.

[1]: ../cloud_functions
[2]: https://github.com/dart-lang/sdk/issues/33979
Expand Down
2 changes: 1 addition & 1 deletion packages/cloud_functions/cloud_functions_web/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: cloud_functions_web
description: The web implementation of cloud_functions
homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/cloud_functions/cloud_functions_web
version: 1.0.2
version: 1.0.3

flutter:
plugin:
Expand Down

0 comments on commit d39ad94

Please sign in to comment.