cordova-plugin-firebasex-functions
v1.0.3
Published
Firebase Cloud Functions module for cordova-plugin-firebasex
Maintainers
Readme
cordova-plugin-firebasex-functions 
Firebase Cloud Functions module for the modular FirebaseX Cordova plugin suite.
This plugin wraps the Firebase Functions SDK and provides methods to call Firebase Cloud Functions from your Cordova app.
Table of Contents
Installation
Install the plugin by adding it to your project's config.xml:
cordova plugin add cordova-plugin-firebasex-functionsor by running:
cordova plugin add cordova-plugin-firebasex-functionsThis module depends on cordova-plugin-firebasex-core which will be installed automatically as a dependency.
Plugin variables
| Variable | Default | Description |
|---|---|---|
| ANDROID_FIREBASE_FUNCTIONS_VERSION | 22.1.0 | Android Firebase Functions SDK version. |
| ANDROID_GSON_VERSION | 2.13.2 | Google Gson library version (Functions dependency). |
| IOS_FIREBASE_SDK_VERSION | 12.9.0 | iOS Firebase SDK version (for functions pod). |
API
The following methods are available via the FirebasexFunctions global object.
functionsHttpsCallable
Call a Firebase HTTPS Callable function.
Parameters:
- {string} name - the name of the function
- {object} args - arguments to send to the function
- {function} success - callback function to call on successfully completing the function call. Will be passed an {object/array/string} containing the data returned by the function.
- {function} error - callback function which will be passed a {string/object} error message as an argument.
var functionName = "myBackendFunction";
var args = {
arg1: "First argument",
arg2: "second argument",
};
FirebasexFunctions.functionsHttpsCallable(
functionName,
args,
function (result) {
console.log("Successfully called function: " + JSON.stringify(result));
},
function (error) {
console.error("Error calling function: " + JSON.stringify(error));
}
);Reporting issues
Before reporting an issue with this plugin, please do the following:
- Check the existing issues to see if the issue has already been reported.
- Check the issue template and provide all requested information.
- The more information and context you provide, the easier it is for the maintainers to understand the issue and provide a resolution.
