Skip to content

Commit

Permalink
[cloud_functions] Update README and dart docs, remove unused paramete…
Browse files Browse the repository at this point in the history
…rs. (firebase#1620)
  • Loading branch information
xqwzts authored and collinjackson committed May 30, 2019
1 parent daf81f2 commit 66f1174
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
4 changes: 4 additions & 0 deletions packages/cloud_functions/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.4.0

* Removed unused `parameters` param from `getHttpsCallable`.

## 0.3.0+1

* Update iOS dependencies to latest.
Expand Down
20 changes: 18 additions & 2 deletions packages/cloud_functions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,26 @@ with Xcode, and within Xcode place the file inside ios/Runner. Don't follow the
import 'package:cloud_functions/cloud_functions.dart';
```

Calling a function:
Getting an instance of the callable function:

```dart
dynamic resp = await CloudFunctions.instance.getHttpsCallable(functionName: 'YOUR_CALLABLE_FUNCTION_NAME').call();
final HttpsCallable callable = CloudFunctions.instance.getHttpsCallable(
functionName: 'YOUR_CALLABLE_FUNCTION_NAME',
);
```

Calling the function:

```dart
dynamic resp = await callable.call();
```

Calling the function with parameters:

```dart
dynamic resp = await callable.call(<String, dynamic>{
'YOUR_PARAMETER_NAME': 'YOUR_PARAMETER_VALUE',
});
```

## Getting Started
Expand Down
10 changes: 5 additions & 5 deletions packages/cloud_functions/lib/src/cloud_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ class CloudFunctions {

final String _region;

/// Executes this Callable HTTPS trigger asynchronously.
/// Gets an instance of a Callable HTTPS trigger in Cloud Functions.
///
/// @param functionName The name of the callable function being triggered.
/// @param parameters Parameters to be passed to the callable function.
HttpsCallable getHttpsCallable(
{@required String functionName, Map<String, dynamic> parameters}) {
/// Can then be executed by calling `call()` on it.
///
/// @param functionName The name of the callable function.
HttpsCallable getHttpsCallable({@required String functionName}) {
return HttpsCallable._(this, functionName);
}
}
2 changes: 1 addition & 1 deletion packages/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.3.0+1
version: 0.4.0
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/cloud_functions

Expand Down

0 comments on commit 66f1174

Please sign in to comment.