Package | com.myflashlab.air.extensions.firebase.core |
Class | public class Firebase |
Inheritance | Firebase Object |
Firebase class is the core ANE you need to initialize before being able to run any of the other Firebase features.
Read this wiki https://github.com/myflashlab/Firebase-ANE/wiki to learn how to initialize the ANE in your project.
Property | Defined By | ||
---|---|---|---|
dataCollectionDefaultEnabled : Boolean [static]
Gets or sets whether automatic data collection is enabled for all products. | Firebase | ||
iid : FirebaseInstanceId [static] [read-only]
Gives you access to the Firebase Instance ID library to allow you manage the instance ID which is also
known as iid. | Firebase | ||
isConnectedToGoogleApiClient : Boolean [static] [read-only]
(Android) Indicates if the ANE is connected to the GoogleApiClient. | Firebase | ||
os : String [static] [read-only]
(Deprecated, instead use the OverrideAir.os property)
Indicates if you are running this ANE on Android or iOS platforms. | Firebase |
Method | Defined By | ||
---|---|---|---|
checkGoogleAvailability($callback:Function):void [static]
(Android) Checks if the minimum Google Play Services SDK is available or not. | Firebase | ||
[static]
This method returns the Firebase configuration details based on GoogleService-Info.plist for iOS
and google-services.json for Android. | Firebase | ||
init($prepareForDynamicLinks:Boolean = false):Boolean [static]
Call this method to initialize the Firebase. | Firebase | ||
makeGooglePlayServicesAvailable($callback:Function):void [static]
(Android) Attempts to make Google Play services available on this device. | Firebase | ||
setLoggerLevel($level:int):void [static]
Sets the logging level for internal Firebase logging. | Firebase |
Constant | Defined By | ||
---|---|---|---|
EXTENSION_ID : String = com.myflashlab.air.extensions.firebase.core [static] | Firebase | ||
FIREBASE_SDK_ANDROID : String = 17.2.1 [static] | Firebase | ||
FIREBASE_SDK_IOS : String = 6.18.0 [static] | Firebase | ||
SERVICE_DISABLED : int = 3 [static] The installed version of Google Play services has been disabled on this device. | Firebase | ||
SERVICE_INVALID : int = 9 [static] The version of the Google Play services installed on this device is not authentic. | Firebase | ||
SERVICE_MISSING : int = 1 [static] Google Play services is missing on this device. | Firebase | ||
SERVICE_UPDATING : int = 18 [static] Google Play service is currently being updated on this device. | Firebase | ||
SERVICE_VERSION_UPDATE_REQUIRED : int = 2 [static] The installed version of Google Play services is out of date. | Firebase | ||
SUCCESS : int = 0 [static] The connection was successful. | Firebase | ||
VERSION : String = 9.9.0 [static] | Firebase |
dataCollectionDefaultEnabled | property |
dataCollectionDefaultEnabled:Boolean
Gets or sets whether automatic data collection is enabled for all products. Defaults to `true` unless `FirebaseDataCollectionDefaultEnabled` is set to `false` in your app's Info.plist. This value is persisted across runs of the app so that it can be set once when users have consented to collection.
public static function get dataCollectionDefaultEnabled():Boolean
public static function set dataCollectionDefaultEnabled(value:Boolean):void
iid | property |
iid:FirebaseInstanceId
[read-only] Gives you access to the Firebase Instance ID library to allow you manage the instance ID which is also known as iid.
public static function get iid():FirebaseInstanceId
isConnectedToGoogleApiClient | property |
isConnectedToGoogleApiClient:Boolean
[read-only]
(Android) Indicates if the ANE is connected to the GoogleApiClient. NOTE:There is really nothing on your side to be done in regard to how the ANE connects to GoogleApiClient. However we have set these properties public because we might need that in future versions.
public static function get isConnectedToGoogleApiClient():Boolean
os | property |
os:String
[read-only]
(Deprecated, instead use the OverrideAir.os
property)
Indicates if you are running this ANE on Android or iOS platforms.
public static function get os():String
checkGoogleAvailability | () | method |
public static function checkGoogleAvailability($callback:Function):void
(Android) Checks if the minimum Google Play Services SDK is available or not. Some of the Firebase features like the FCM is dependent on Google Play Services SDK and this method will help you make sure if the feature can function correctly on user's device or not.
(iOS) will always return Firebase.SUCCESS
Parameters
$callback:Function — ANE will check Google Services SDK availability and returns the result to this function.
|
Firebase.checkGoogleAvailability(onCheckResult); private function onCheckResult($result:int):void { switch($result) { case Firebase.SUCCESS: trace("checkGoogleAvailability result = SUCCESS"); break; case Firebase.SERVICE_MISSING: trace("checkGoogleAvailability result = SERVICE_MISSING"); break; case Firebase.SERVICE_VERSION_UPDATE_REQUIRED: trace("checkGoogleAvailability result = SERVICE_VERSION_UPDATE_REQUIRED"); break; case Firebase.SERVICE_UPDATING: trace("checkGoogleAvailability result = SERVICE_UPDATING"); break; case Firebase.SERVICE_DISABLED: trace("checkGoogleAvailability result = SERVICE_DISABLED"); break; case Firebase.SERVICE_INVALID: trace("checkGoogleAvailability result = SERVICE_INVALID"); break; } }
getConfig | () | method |
public static function getConfig():FirebaseConfig
This method returns the Firebase configuration details based on GoogleService-Info.plist
for iOS
and google-services.json
for Android.
Moreover, you can set WebApiKey into this object. Some Firebase child ANEs may need this information. Some of the child ANEs which need this are for example the DynamicLinks ANE.
ReturnsFirebaseConfig — |
init | () | method |
public static function init($prepareForDynamicLinks:Boolean = false):Boolean
Call this method to initialize the Firebase. You must init Firebase the soonest possible in your app.
Parameters
$prepareForDynamicLinks:Boolean (default = false ) — Set this to true if you are going to use the DynamicLinks ANE in your app.
|
Boolean — returns true if the Firebase configuration has been found.
|
$prepareForDynamicLinks
parameter to true
,
make sure you are setting your custom scheme key in your manifest .xml file as follow:
<key>com.myflashlabs.firebase.deepLinkURLScheme</key> <string>YourCustomSchemeString</string>
makeGooglePlayServicesAvailable | () | method |
public static function makeGooglePlayServicesAvailable($callback:Function):void
(Android) Attempts to make Google Play services available on this device. If Play Services is already
available, the $callback
may be called immediately.
(iOS) the $callback
will be called immediately with no error.
Parameters
$callback:Function |
Firebase.makeGooglePlayServicesAvailable(onResult); private function onResult($error:Error):void { if($error) { trace($error.message); } else { trace("Success"); } }
setLoggerLevel | () | method |
public static function setLoggerLevel($level:int):void
Sets the logging level for internal Firebase logging.
Parameters
$level:int (default = NaN ) — can be one of the following values:
|
EXTENSION_ID | Constant |
public static const EXTENSION_ID:String = com.myflashlab.air.extensions.firebase.core
FIREBASE_SDK_ANDROID | Constant |
public static const FIREBASE_SDK_ANDROID:String = 17.2.1
FIREBASE_SDK_IOS | Constant |
public static const FIREBASE_SDK_IOS:String = 6.18.0
SERVICE_DISABLED | Constant |
public static const SERVICE_DISABLED:int = 3
The installed version of Google Play services has been disabled on this device.
SERVICE_INVALID | Constant |
public static const SERVICE_INVALID:int = 9
The version of the Google Play services installed on this device is not authentic.
SERVICE_MISSING | Constant |
public static const SERVICE_MISSING:int = 1
Google Play services is missing on this device.
SERVICE_UPDATING | Constant |
public static const SERVICE_UPDATING:int = 18
Google Play service is currently being updated on this device.
SERVICE_VERSION_UPDATE_REQUIRED | Constant |
public static const SERVICE_VERSION_UPDATE_REQUIRED:int = 2
The installed version of Google Play services is out of date.
SUCCESS | Constant |
public static const SUCCESS:int = 0
The connection was successful.
VERSION | Constant |
public static const VERSION:String = 9.9.0