-
Notifications
You must be signed in to change notification settings - Fork 16
O.2 Init Functions
You can initialize the Functions ANE by calling Functions.init(null);
As soon as you initialized the firebaseFunctions.ane in your project, you will be able to call the callable functions which are deployed to your Firebase console.
Notice: Before initializing Functions, you must have already successfuly initialized the FirebaseCore.
Cloud Functions is regional, which means the infrastructure that runs your Cloud Function is located in specific regions and is managed by Google to be redundantly available across all the zones within those regions.
When selecting what regions to run your functions in, your primary considerations should be latency and availability. You can generally select regions close to your users, but you should also consider the location of the other products and services that your app uses. Using services across multiple regions can affect your app's latency, as well as pricing.
Cloud Functions is available in the following regions:
us-central1 (Iowa)
us-east1 (South Carolina)
europe-west1 (Belgium)
europe-west2 (London)
asia-east2 (Hong Kong)
asia-northeast1 (Tokyo)
When initializing the Functions, you can specify the region as follow.
import com.myflashlab.air.extensions.firebase.functions.Functions;
// pass null and the default value, us-central1, will be used
Functions.init("us-central1");
// prepare a JSON-format Object
var obj:Object = {text:"This msg is sent from AIR!"};
Functions.callFunction("helloWorldForAIR", obj, function ($data:String, $error:Error):void
{
if($error)
{
trace($error.errorID + " > " + $error.message);
}
else
{
trace($data);
}
});
The helloWorldForAIR
is the name of the Function which you have already deployed. To know how functions are written and deployed to server, read here.
Enjoy building Air apps – With ♥ from MyFlashLabs Team
Introduction to Firebase ANEs collection for Adobe Air apps
Get Started with Firebase Core in AIR
- Prerequisites
- Add Firebase to your app
- Add the Firebase SDK
- Init Firebase Core
- Available ANEs
- Managing Firebase iid
Get Started with Authentication
- Add Authentication
- Init Authentication
- Manage Users
- Phone Number
- Custom Auth
- Anonymous Auth
- State in Email Actions
- Email Link Authentication
Get Started with FCM + OneSignal
- Add FCM ANE
- Init FCM ANE
- Send Your 1st Message
- Send Msg to Topics
- Understanding FCM Messages
- init OneSignal
- Add Firestore
- Init Firestore
- Add Data
- Transactions & Batches
- Delete Data
- Manage the Console
- Get Data
- Get Realtime Updates
- Simple and Compound
- Order and Limit Data
- Paginate Data
- Manage Indexes
- Secure Data
- Offline Data
- Where to Go From Here
Get Started with Realtime Database
- Add Realtime Database
- Init Realtime Database
- Structure Your Database
- Save Data
- Retrieve Data
- Enable Offline Capabilities
Get Started with Remote Config
- Add Storage ANE
- Init Storage ANE
- Upload Files to Storage
- Download Files to Air
- Use File Metadata
- Delete Files