Skip to content

πŸ”₯ Use the Firebase SDK in Titanium

Notifications You must be signed in to change notification settings

hansemannn/titanium-firebase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

56 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Firebase in Axway Titanium

Firebase in Appcelerator Titanium

This project will contain all Firebase-related modules for Analytics, Cloud-Messaging, Authentication, Firestore etc.

Requirements

  • iOS: Titanium SDK 6.3.0+
  • Android: Titanium SDK 7.0.0+ and Ti.PlayServices

Demo

⏩ hansemannn/titanium-firebase-demo

Installation

  1. Download the core-module titanium-firebase-core

  2. Download the desired feature-module(s) from the below list

  3. Unpack them to your project directory

  4. 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)
    • 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:
    <?xml version="1.0" encoding="UTF-8"?>
    <resources>
    	<string name="google_app_id">1:11111111111:android:aaaaaaaaa</string>
    </resources>

    * Alloy

  5. Require the your modules and call the configure method to configure your Firebase application:

var FirebaseCore = require('firebase.core');
FirebaseCore.configure();
  1. You are good to go!

Android notes

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.

Features

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

⚠️ Android Notes

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.

Disable Analytics

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>

Contributors

License

Apache 2.0