-
Notifications
You must be signed in to change notification settings - Fork 16
O.0 Write Functions
You can write Firebase Functions in JavaScript or TypeScript. Functions can be called from your AIR app and you can send out parameters to them in JSON String format and functions can return to you the results in JSON String format.
The official Firebase docs have great information about what you can do with Functions and they will also teach you how to install and setup the Firebase Functions CLI on your computer. So, below I will only link to useful information on the official docs. But feel free to study the Google docs for more information about Functions. They also have a lot of great examples on how Functions should be written and deployed.
After you are ready with writting and deploying Functions, you may add the Functions ANE to your app and start calling them.
- What can I do with Cloud Functions?
- Begin with Functions, video tutorial
- Installing the CLI and writting some Functions
- Trigger background Functions:
- Monitor Functions Logs
A simple Function for you to test with your AIR app can be the following Function written in JavaScript. This Function expects to be called from a mobile app because it is functions.https.onCall
. It accepts params like: {text:"some String"}
. and finally returns a JSON object back to AIR.
exports.helloWorldForAIR = functions.https.onCall((data, context) => {
// Message text passed from AdobeAIR.
const text = data.text;
// returning result.
return {
var1: 'value from server!',
var2: 'value from AIR: ' + text
};
});
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