Package | com.myflashlab.air.extensions.firebase.functions |
Class | public class Functions |
Inheritance | Functions Object |
Method | Defined By | ||
---|---|---|---|
callFunction($name:String, $params:Object, $callback:Function = null):void [static]
Call a 'callable' function on server. | Functions | ||
getTimeout($name:String):int [static]
Returns the timeout for calls from this instance of Functions. | Functions | ||
init($region:String = null):void [static]
Init the Functions ANE and optionally pass in a region. | Functions | ||
setTimeout($name:String, $timeout:int):void [static]
Changes the timeout for calls from the instance of Functions. | Functions |
Constant | Defined By | ||
---|---|---|---|
EXTENSION_ID : String = com.myflashlab.air.extensions.firebase.functions [static] | Functions | ||
VERSION : String = 9.9.0 [static] | Functions |
callFunction | () | method |
public static function callFunction($name:String, $params:Object, $callback:Function = null):void
Call a 'callable' function on server. Notice that server functions should be of type
functions.https.onCall
so they can be called from Android or iOS apps.
Parameters
$name:String | |
$params:Object | |
$callback:Function (default = null )
|
exports.helloWorld = functions.https.onCall((data, context) => { // Message text passed from the client. const text = data.text; // returning result. return { var1: 'value from server!', var2: 'value from AIR: ' + text };
function($data:String, $error:Error):void { // $data: is a String is JSON format. Could be an Array or an Object depending on what format the server side returns. // $error: If an error occurred, this error object describes the error. If the operation was completed successfully, the value is null. }
getTimeout | () | method |
public static function getTimeout($name:String):int
Returns the timeout for calls from this instance of Functions. It's just for Android.
Parameters
$name:String — The name of the endpoint this reference refers to.
|
int — The timeout, in milliseconds.
|
init | () | method |
public static function init($region:String = null):void
Init the Functions ANE and optionally pass in a region. To understand Firebase Functions locations, read here: https://firebase.google.com/docs/functions/locations
Parameters
$region:String (default = null )
|
setTimeout | () | method |
public static function setTimeout($name:String, $timeout:int):void
Changes the timeout for calls from the instance of Functions. The default is 60 seconds. It's just for Android.
Parameters
$name:String — The name of the endpoint this reference refers to.
| |
$timeout:int — The length of the timeout, in the given units.
|
EXTENSION_ID | Constant |
public static const EXTENSION_ID:String = com.myflashlab.air.extensions.firebase.functions
VERSION | Constant |
public static const VERSION:String = 9.9.0