Firebase ANE gives you access to the Google Firebase project in your AdobeAir projects supported on both Android and iOS with 100% identical ActionScript API.
If you decide to use Firebase in your next AdobeAir project, you should consider the following structure: Firebase Air Native Extension is consist of a Core ANE plus some other individual ANEs which are all dependent on the Core. i.e, If you wish to use Firebase Cloud Messaging (FCM), you need to embed the Core ANE first and then use the required ANE(s) for the FCM. This structure will make sure that you are not compiling unused native code in your AdobeAir project. In result, your app file size will be as small as possible and faster to debug/compile. The Wiki pages will provide you detailed information about how you can embed each ANE based on the Firebase feature you wish to use in your app.
Main Features:
- Analytics Reimagine analytics for mobile
- Cloud Messaging (FCM) Deliver and receive messages across platforms reliably
- Authentication Reduce friction with robust authentication
- Realtime Database Store and sync app data in realtime
- Firestore Store and sync app data at global scale
- Storage Store files with ease
- Remote Config Customize your app on the fly
- Crash Reporting Keep your app stable
- Notifications Engage with users at the right moment
- Dynamic Links Send users to the right place inside your app
- Invites Empower your users to share your app
- AdWords Acquire users with the reach of Google
- Admob Monetize through engaging ads
find the latest asdoc for this ANE here.
How to get started? read here
- Firebase Core
- Firebase Realtime Database
- Firebase Firestore
- Firebase Remote Config
- Firebase Authentication
- Firebase Dynamic Links
- Firebase Invites
- Firebase Storage
- Firebase Analytics
- Firebase Crash Report
- Firebase FCM
import com.myflashlab.air.extensions.dependency.OverrideAir;
import com.myflashlab.air.extensions.firebase.core.*;
// remove this line in production build or pass null as the delegate
OverrideAir.enableDebugger(myDebuggerDelegate);
function myDebuggerDelegate($ane:String, $class:String, $msg:String):void
{
trace($ane + "(" + $class + ")" + " " + $msg);
}
// initialize the Firebase as early as possible in your project
var isConfigFound:Boolean = Firebase.init();
// If you wish to see the Firebase SDK debugging logs in detail, use the following
Firebase.setLoggerLevel(FirebaseConfig.LOGGER_LEVEL_MAX);
/*
Calling Firebase.init() is just good enough to initialize Firebase core in your Air
project. However for debugging reasons, you can check the config values like below:
What config files you may ask? well, This is explained in details in the Wiki pages.
https://github.com/myflashlab/Firebase-ANE/wiki but to give you a quick idea, I
should say that before being able to start with Firebase, you need to create a
Firebase account (It's free) and introduce your app to your Firebase console. When
you do that, your Firebase console will give you a config file. it will be a .plist
for iOS "GoogleService-Info.plist" and a .json file "google-services.json" for the
Android side. The content of these two config files are similar to these:
https://github.com/myflashlab/Firebase-ANE/tree/master/FD/bin
You need to make sure that these two config files are being embedded in your project
by putting them in the bin folder of your project. (Next to the main .swf file of
your app)
*/
if (isConfigFound)
{
var config:FirebaseConfig = Firebase.getConfig();
trace("default_web_client_id = " + config.default_web_client_id);
trace("firebase_database_url = " + config.firebase_database_url);
trace("gcm_defaultSenderId = " + config.gcm_defaultSenderId);
trace("google_api_key = " + config.google_api_key);
trace("google_app_id = " + config.google_app_id);
trace("google_crash_reporting_api_key = " + config.google_crash_reporting_api_key);
trace("google_storage_bucket = " + config.google_storage_bucket);
trace("project_id = " + config.project_id);
// You must init other Firebase children after a successful initialization of the Core ANE.
// readyToUseFirebase();
}
else
{
trace("Config file is not found!");
}
/*
To know how to use other features of Firebase, read the Wiki:
https://github.com/myflashlab/Firebase-ANE/wiki
*/
Firebase ANEs are dependent on some other ANEs and frameworks. Complete information about these dependencies are explained in wiki pages. However, to make sure you are not confused with all these settings, you are encouraged to use the ANE-LAB Software.
- Android API 15+
- iOS SDK 8.0+
- Air SDK 27+
- Every Firebase ANE might need some dependency Frameworks/ANEs which is explained in details here.
- firebaseCore.ane
- firebaseDatabase.ane
- firebaseFirestore.ane
- firebaseRemoteConfig.ane
- firebaseAuth.ane
- firebaseDynamicLinks.ane
- firebaseInvites.ane
- firebaseStorage.ane
- firebaseAnalytics.ane
- firebaseCrash.ane
- firebaseMessaging.ane
How to embed ANEs into FlashBuilder, FlashCC and FlashDevelop
How to support Firebase in my Air app?
How to use Firebase Realtime database?
How to use Firebase Firestore?
How to use Firebase Remote Config?
How to use Firebase Authentication?
How to use Firebase Storage?
How to use Firebase Crash?
How to use Firebase FCM?
How to use Firebase Analytics?
How to use Firebase Dynamic Links?
How to use Firebase Invites?
Dec 15, 2017 - V6.0.0
- Updated to Firebase SDK 11.6.0 for Android. Make sure to update all your dependency files based on this information
- Updated to Firebase SDK 4.6.0 for iOS. Make sure you are updating the frameworks and resources based on this information
- (Core) You need to regenerate the core ANE using the ane generator software V6.0.0 and you need to update all the other Firebase children that you are using in your project.
- (Core) Remove the following receiver from your manifest:
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" android:exported="false"/>
- (Core) The
projectID
property from theFirebaseConfig
class is now deprecated and you no longer can set it manually. This property will be set automatically from now on and you can see its value with the following getter:project_id
. - (Analytics) Added new method
resetAnalyticsData()
which works on the Android side only. - (Auth) Added
FirebaseUser.metadata
. - (Auth) Added
ActionCodeSettings
to sendPasswordResetEmail and sendEmailVerification - (Dynamic-Links) You no longer have to set
Firebase.getConfig().projectID
. This will happen automatically from now on. However, you still need to setFirebase.getConfig().webApiKey
manually. - Firestore is now added and you can start using it. Start by reading the wiki on how to initialize Firestore.
Sep 03, 2017 - V5.1.1
- (Core) Fixed issue 148. The core ANE must be regenerated with the new ane generator V5.1.1.
Aug 21, 2017 - V5.1.0
- (Core) the core ANE must be regenerated with the new ane generator V5.1.0.
- (Core) Added API for managing FirebaseInstanceId. You can now manualy delete and regenerate new iid ID and tokens.
- (Core) You need to add the following service to your manifest right after the
<provider ....
tag.
<service
android:name="com.myflashlab.firebase.core.MyFirebaseInstanceIdService"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
Jul 19, 2017 - V5.0.0
- Updated to Firebase SDK 11.0.2 for Android. Make sure to update all your dependency files based on this information
- Updated to Firebase SDK 4.0.3 for iOS. Make sure you are updating the frameworks based on this information
- From now on, sample files are in IntelliJ IDE.
- (Core) You need to regenerate the core ANE using the ane generator software V5.0.0 and you need to update all the other Firebase children that you are using in your project.
- (Core) Remove the following from your manifest:
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
- (Analytics) The following service must be added to the manifest:
<service
android:name="com.google.android.gms.measurement.AppMeasurementJobService"
android:permission="android.permission.BIND_JOB_SERVICE"
android:enabled="true"
android:exported="false"/>
- (Auth) Corrected miss-spelling described at issue https://github.com/myflashlab/Firebase-ANE/issues/42
- (Auth)
Auth.RESULT_TOO_MANY_REQUESTS
introduced. - (Auth) Listener
AuthEvents.ID_TOKEN_CHANGED
introduced. Listen to this even just like how you used to listen toAuthEvents.AUTH_STATE_CHANGED
- (Auth) Added support for Phone verification and sign in.
Auth.verifyPhoneNumber()
, Check Wiki to know how you can use this feature. - (Auth) The new Phone verification feature on iOS will run only if you have setup push-notification on your app. To know how to do that, read the setup information for FCM. If FCM is already added to your app, you're just good to go.
- (Crash)
Crash.crashCollectionEnabled
introduced - (DynamicLinks) You need to add the follwoing dependency to your manifest:
<extensionID>com.myflashlab.air.extensions.dependency.firebase.dynamicLinks</extensionID>
Mar 07, 2017 - V4.0.0
- Updated to Firebase SDK 10.2.0 for Android. Make sure to update all your dependency files based on this information
- Updated to Firebase SDK 3.13.0 for iOS. Make sure you are updating the frameworks based on this information
- firebaseInvites.ane has been added to the collection and it is highly dependent on on DynamicLinks ANE. In simple terms, if you wish to use the Firebase Invites SDK, you need to first add Firebase DynamicLinks to your app.
- (Core) You need to regenerate the core ANE using the ane generator software V4.0.0 and you need to update all the other Firebase children that you are using in your project.
- (Core) setLoggerLevel has been intrduced and logLevel is now deprecated.
- (Core) Prior to this updated, other ANE dependencies were not required for iOS builds but from now on, you need to add
overrideAir.ane
even if you are building for iOS only. Just make sure you are reading this information very carefully. - (Auth) Added signInWithEmail
- (Auth) Added signInWithCustomToken
- (Auth) Added confirmPasswordResetWithCode
- (Auth) Added checkActionCode
- (Auth) Added verifyPasswordResetCode
- (Auth) Added applyActionCode
- (Auth) fixed issue 84
- (Analytics) Firebase team fixed issue 34 and we made sure it is also working on the ANE side.
- (Analytics) Added getAppInstanceID
- (DB) fixed issue 65
- (DB) fixed setValue and updateChilderen methods so they are now correctly removing values at targetted references if you are sending an empty String
""
at those references. - (FCM) You can now use the Resource Manager Software to add custom icons for notifications on the Android side. iOS shows app icon only. Firebase does not support this
- (FCM) You can create custom .caf files for iOS notifications to play custom sounds when a notification arrives.
- (FCM) known issue: custom sounds for Android must be placed in the res/raw folder using the Resource Manager Software but unfortunately this is not working because it seems like AIR is somehow compressing the files inside the raw folder. We will bring this issue to Adobe's attention so maybe they can fix this problem.
- Minor bug fixes on the ANE side.
- With upgrading to the latest Firebase SDK, a lot of native bugs are also fixed. You can learn about them by checking the official native Firebase release notes.
Jan 14, 2017 - V3.0.0
- Firebase Core ANE needs the
appinvite
dependency also from now on. - You will need AIR SDK 24 or higher to compile Firebase ANEs. Older SDKs are just too old to support Firebase from mow on.
- firebaseDynamicLinks.ane has been added and works on both Android and iOS. To make sure it works correctly, you need to initialize dynamicLinks as soon as possible in your app, right after you initialized the Core Firebase ANE.
Firebase.init(true);
FirebaseConfig
now has two getter/setter properties (projectID
andwebApiKey
) which can be used for accessing dynamicLinks REST API.- Firebase.init accepts a boolean which is set to
false
by default. If set totrue
, the ANE will be prepared to use DynamicLinks. FirebaseEvents
has been introduced which notifies you when GoogleApiClient is connected or disconnected. You may find these events helpful only on the Android side when working with DynamicLinks. These events will not be dispatched at all when you're running on iOS.- If you are going to add DynamicLinks to your project, read the Wiki and make sure you are generating new provision files for iOS. Your old provisions will not work with DynamicLinks.
Nov 27, 2016 - V2.0.0
- Updated to Firebase SDK 10.0.0 for Android. Make sure to update all your dependency files based on this information
- Updated to Firebase SDK 3.10.0 for iOS. Make sure you are updating the frameworks based on this information
- All Firebase ANEs are now optimized for AIR 24
- Minimum iOS version to support the Firebase ANEs will be iOS 8.0+ from now on
- (Auth) Added sendEmailVerification method
- (Auth) Added isEmailVerified property
- (Auth) Added fetchProvidersForEmail method
- (Crash) You no longer need to add services to the manifest Android side.
- Minor bug fixes on the ANE side.
- With upgrading to the latest Firebase SDK, a lot of native bugs are also fixed. You can learn about them by checking the official native Firebase release notes.
Oct 19, 2016
- Added FCM
Oct 05, 2016
- Added Analytics
Oct 04, 2016
- Added FCM beta
Sep 25, 2016 - V1.2.0
- Updated to Firebase SDK 9.6.1 for Android. Make sure to update all your dependency files also.
- Updated to Firebase SDK 3.6.0 for iOS. Make sure you are updating the frameworks too.
- (DB) Added Child and single events requested on issue #15
- (DB) Fixed Query EndAt method on iOS reported on issue #16
- (DB) Added
DBServerValue
class requested on issue #10 - (Auth) Added signInAnonymously. Simply pass
null
to the signIn() method. issue #8 - The
checkDependencies
method is now deprecated in all Firebase ANEs. instead, you should use the Inspector ANE if you wish to check the availablity of dependencies.
Sep 13, 2016
- Added Crash
Sep 06, 2016
- Added Storage
Aug 10, 2016 - V1.1.0
- Updated to Firebase SDK 9.4.0 for Android. Make sure to update all your dependency files also.
- Updated to Firebase SDK 3.4.0 for iOS. Make sure you are updating the Frameworks also.
- minor bug fixes
Jul 25, 2016
- Added Remote config and Authentication
Jul 21, 2016
- Realtime database and the core are ready for beta testing
Jul 05, 2016 - V1.0.0
- beginning of the journey!
DISCRIMINATION: Firebase SDKs are developed by Google and they own every copyright to the Firebase "native" projects. However, we have used their "compiled" native SDKs to develop the ActionScript API to be used in Adobe Air mobile projects. Moreover, as far as the documentations, we have copied and when needed has modified the Google documents so it will fit the needs of Adobe Air community. If you wish to see the original documentations in Android/iOS, visit here. But if you are interested to do things in Adobe Air, then you are in the right place.