This project will contain all Firebase-related modules for Analytics, Cloud-Messaging, Authentication, Firestore etc.
- iOS: Titanium SDK 6.3.0+
- Android: Titanium SDK 7.0.0+ and Ti.PlayServices
β© hansemannn/titanium-firebase-demo
-
Download the core-module titanium-firebase-core
-
Download the desired feature-module(s) from the below list
-
Unpack them to your project directory
-
Configure your Firebase project
- iOS:
- Download the
GoogleService-Info.plist
from your project and copy it to[application_name]/Resources/iphone/
(classic) or[application_name]/app/assets/iphone
(Alloy)
- Download the
- Android:
- Download the
google-services.json
and copy it to[application_name]/Resources/android/
(classic) or[application_name]/app/assets/android/
(Alloy) - Create the follwing XML file
[application_name]/[app*]/platform/android/res/values/strings.xml
containing:
- Download the
<?xml version="1.0" encoding="UTF-8"?> <resources> <string name="google_app_id">1:11111111111:android:aaaaaaaaa</string> </resources>
* Alloy
- iOS:
-
Require the your modules and call the
configure
method to configure your Firebase application:
var FirebaseCore = require('firebase.core');
FirebaseCore.configure();
- You are good to go!
For Android apps it is best to create a XML file at platform/android/res/values/strings.xml
and place your configuration there:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<! -- Present in all applications -->
<string name="google_app_id" translatable="false">xxx</string>
<! -- Present in applications with the appropriate services configured -->
<string name="gcm_defaultSenderId" translatable="false">xxx</string>
<string name="default_web_client_id" translatable="false">xxx</string>
<string name="firebase_database_url" translatable="false">xxx</string>
<string name="google_api_key" translatable="false">xxx</string>
<string name="google_crash_reporting_api_key" translatable="false">xxx</string>
<string name="project_id" translatable="false">xxx</string>
</resources>
Use the values from the google-services.json
.
The list of supported features will be updated once a new feature is added to the list. Feel free to take over a new feature by creating the module and making a pull-request to update this readme.
Feature | Repository | iOS | Android | Releases |
---|---|---|---|---|
Core (required) | titanium-firebase-core | β | β | Download |
Analytics | titanium-firebase-analytics | β | β | Download |
Performance | titanium-firebase-performance | β | β | Download |
Authentication | titanium-firebase-auth | β | β | Download |
Cloud Messaging | titanium-firebase-cloud-messaging | β | β | Download |
Crashlytics | titanium-crashlytics | β | β | Download |
Remote Config | titanium-firebase-config | β | β | Download |
Storage | titanium-firebase-storage | β | β | Download |
Database | titanium-firebase-database | β | β | Download |
If this module is used together with other modules that use the Google Play Services (e.g. Ti.Map or Ti.Admob) you have to use at least Titanium SDK 7.0.0 for Android which resolves duplicate dependencies for you.
Latest module versions that support 7.0.0 and have Ti.PlayServices included:
You are not using 7.0.0 because of modules that are not updated so far? Update open source modules quickly by using the Android 64-Bit Migration Guide.
By default Firebase trys to use Analytics and you might see the erros in your log:
[ERROR] FA: AppMeasurementReceiver not registered/enabled
[ERROR] FA: AppMeasurementService not registered/enabled
[ERROR] FA: Uploading is not possible. App measurement disabled
To disable them you can add the follwing elements to the <application>
part of your tiapp.xml:
<application>
<meta-data android:name="firebase_analytics_collection_enabled" android:value="false"/>
<meta-data android:name="google_analytics_adid_collection_enabled" android:value="false"/>
</application>
- Please see https://github.com/hansemannn/titanium-firebase/graphs/contributors
- Interested in contributing? Read the contributors/committer's guide.
Apache 2.0