Git Product home page Git Product logo

titanium-firebase's Introduction

Firebase in Axway Titanium

Firebase in Appcelerator Titanium

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

Supporting this effort

The whole Firebase support in Titanium is developed and maintained by the community (@hansemannn and @m1ga). To keep this project maintained and be able to use the latest Firebase SDK's, please see the "Sponsor" button of this repository, thank you!

Premium supporter

Centreville Tech

Centreville Tech are strategic design+development advisors based in central Alabama.

Centreville Tech

Requirements

  • iOS: Titanium SDK 9.2.0+
  • Android: Titanium SDK 9.0.0+ and Ti.PlayServices

Demo

โฉ hansemannn/titanium-firebase-demo

Installation

  1. Download the core-module titanium-firebase-core - only needed for iOS

  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]/platform/android/ (classic) or [application_name]/app/platform/android/ (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!

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
In-App Messaging titanium-firebase-in-app-messaging โœ… โœ… Download
Crashlytics titanium-crashlytics โœ… โœ… Download
Remote Config titanium-firebase-config โœ… โœ… Download
Firestore titanium-firebase-firestore โœ… โœ… Download
Storage titanium-firebase-storage โœ… โŒ Download
Database titanium-firebase-database โœ… โŒ Download

โš ๏ธ Android Notes

The titanium-firebase-core module is not required for Android anymore. If you use it it will add AdMob as a dependency which is found by the Play-Store even if you don't use it. So if you don't need it you don't include titanium-firebase-core into your project. The config from google-services.json is automatically included by gradle.

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

titanium-firebase's People

Contributors

arood avatar hansemannn avatar m1ga avatar r4mpancy avatar wingee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

titanium-firebase's Issues

iOS 14 IDFA permissions

Hi,

Will the modules still work as expected if use of the IDFA is not allowed by the user in iOS 14?

I'm reading that if the IDFA is not available, then the Vendor Identifier will be used.

Thanks,
Eric

Runing application simulator getting issue

Hello Team ,How to use Firebase using titanium please help me.Right now i tried gittio demo firebase.auth module but facing below issue [ERROR] : ** BUILD FAILED **
[ERROR] : The following build commands failed:
[ERROR] : Ld /Users/vidyayugmac10/Documents/Appcelerator_Work_POC/pocZoom/build/iphone/build/Products/Debug-iphonesimulator/pocZoom.app/pocZoom normal x86_64
[ERROR] : (1 failure)

NoClassDefFoundError

Hello,

I followed the README for installing this plugin into my Titanium project, but I keep getting this crash on startup. I am using these versions for firebase integration:

  • firebase.core: 5.0.0 (Android), 2.2.0 (iPhone)
  • firebase.analytics: 3.0.0 (Android), 1.4.1 (iPhone)
  • ti.crashlytics: 1.1.1 (Android), 1.2.2 (iPhone)

Is there anything I can do to resolve this error?

2019-07-26 09:57:21.613 26502-26502/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: nl.dtt.checkyoursafety, PID: 26502
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/analytics/connector/AnalyticsConnector;
at com.google.firebase.analytics.connector.internal.AnalyticsConnectorRegistrar.getComponents(Unknown Source:2)
at com.google.firebase.components.ComponentRuntime.(com.google.firebase:firebase-common@@16.1.0:56)
at com.google.firebase.FirebaseApp.(com.google.firebase:firebase-common@@16.1.0:553)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@16.1.0:365)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@16.1.0:332)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@16.1.0:316)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common@@16.1.0:53)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1940)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1915)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common@@16.1.0:47)
at android.app.ActivityThread.installProvider(ActivityThread.java:6729)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6276)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6191)
at android.app.ActivityThread.access$1200(ActivityThread.java:236)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1784)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7037)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.analytics.connector.AnalyticsConnector" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/nl.dtt.checkyoursafety-sYaqCr7slOU3D7zkKukv7Q==/base.apk"],nativeLibraryDirectories=[/data/app/nl.dtt.checkyoursafety-sYaqCr7slOU3D7zkKukv7Q==/lib/arm64, /data/app/nl.dtt.checkyoursafety-sYaqCr7slOU3D7zkKukv7Q==/base.apk!/lib/arm64-v8a, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.google.firebase.analytics.connector.internal.AnalyticsConnectorRegistrar.getComponents(Unknown Source:2)ย 
at com.google.firebase.components.ComponentRuntime.(com.google.firebase:firebase-common@@16.1.0:56)ย 
at com.google.firebase.FirebaseApp.(com.google.firebase:firebase-common@@16.1.0:553)ย 
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@16.1.0:365)ย 
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@16.1.0:332)ย 
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@16.1.0:316)ย 
at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common@@16.1.0:53)ย 
at android.content.ContentProvider.attachInfo(ContentProvider.java:1940)ย 
at android.content.ContentProvider.attachInfo(ContentProvider.java:1915)ย 
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common@@16.1.0:47)ย 
at android.app.ActivityThread.installProvider(ActivityThread.java:6729)ย 
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6276)ย 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6191)ย 
at android.app.ActivityThread.access$1200(ActivityThread.java:236)ย 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1784)ย 
at android.os.Handler.dispatchMessage(Handler.java:106)ย 
at android.os.Looper.loop(Looper.java:214)ย 
at android.app.ActivityThread.main(ActivityThread.java:7037)ย 
at java.lang.reflect.Method.invoke(Native Method)ย 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)ย 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)ย 

Getting Exception

I am getting bellow exception please check

[ERROR] : TiExceptionHandler: (main) [0,664] - Message: Uncaught Default FirebaseApp is not initialized in this process .... Make sure to call FirebaseApp.initializeApp(Context) first.

Android Firebase.core crash app

Hello,

When I add firebase.core module to my project, the app on device crash directly and doesn't start.
I tried on different devices with different titanium SDK, I have the same issue.

What do you advise to me to do please ?
thanks in advance.

Default app has already been configured

Dear Mr. Knochel,

How to Delete/destroy/re-configured the Default app in this module?
When I logout from the apps and then re-login again, this error showed up.

Thanks in advance

Uncaught translation error: java.lang.IllegalArgumentException

Hi,
I've been trying to integrate Firebase/Push Notifications into my Titanium app and I am getting this issue while compilation with firebase.core module. Stack trace as follows:

[INFO] : Running dexer: (ARGS)
[ERROR] : Failed to run dexer:
[ERROR] :
[ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lfirebase/core/TitaniumFirebaseCoreBootstrap;
[ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lfirebase/core/TitaniumFirebaseCoreModule;
[ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lfirebase/core/TitaniumFirebaseCoreModule$1;
[ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lfirebase/core/TitaniumFirebaseCoreModule$2;
[ERROR] : 4 errors; aborting
[ERROR] Application Installer abnormal process termination. Process exit value was 1

Any help regarding this would be much appreciated
Project Config :
Titanium v7.5.0
Node v 11.6.0
firebase.core v3.2.0 (also tried with 3.0.0 and 2.3.0)
ti.playservices v11.0.40 (also tried with 11.8.0)
hyperloop v3.1.4
Appc v7.0.9

Thanks

Suggestion: List module versions in the readme

I often find myself having to go through my projects and each submodule to check if there are any updates to do. It would be nice time-saver if you could see the latest version of each module in the overview.

Perhaps the easiest way would be to include a badge in each repo that can be linked in the Features-table? It might even be possible to create automatically with some kind of badge generator?

Error after upgrading to 6.0.0 Android

[ERROR] TiExceptionHandler: (main) [2,1375] /PushNotifications.js:51
[ERROR] TiExceptionHandler: fcm.registerForPushNotifications();
[ERROR] TiExceptionHandler: ^
[ERROR] TiExceptionHandler: Error: Default FirebaseApp is not initialized in this process . Make sure to call FirebaseApp.initializeApp(Context) first.
[ERROR] TiExceptionHandler: at registerForFireBaseAndroid (/PushNotifications.js:51:5)
[ERROR] TiExceptionHandler: at /PushNotifications.js:18:1
[ERROR] TiExceptionHandler: at Module._runScript (ti:/module.js:587:9)
[ERROR] TiExceptionHandler: at Module.load (ti:/module.js:106:7)
[ERROR] TiExceptionHandler: at Module.loadJavascriptText (ti:/module.js:436:9)
[ERROR] TiExceptionHandler: at Module.loadAsFile (ti:/module.js:488:15)
[ERROR] TiExceptionHandler: at Module.loadAsFileOrDirectory (ti:/module.js:410:20)
[ERROR] TiExceptionHandler: at Module.require (ti:/module.js:290:17)
[ERROR] TiExceptionHandler: at Module.global.Module.require (:4754:34)
[ERROR] TiExceptionHandler: at require (ti:/module.js:550:15)
[ERROR] TiExceptionHandler:
[ERROR] TiExceptionHandler: com.google.firebase.FirebaseApp.getInstance(com.google.firebase:firebase-common@@19.3.0:184)
[ERROR] TiExceptionHandler: com.google.firebase.iid.FirebaseInstanceId.getInstance(com.google.firebase:firebase-iid@@20.2.1:1)
[ERROR] TiExceptionHandler: firebase.cloudmessaging.CloudMessagingModule.registerForPushNotifications(CloudMessagingModule.java:108)
[ERROR] TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Object.nativeCallProperty(Native Method)
[ERROR] TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Object.callProperty(V8Object.java:75)
[ERROR] TiExceptionHandler: org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1224)
[ERROR] TiExceptionHandler: android.os.Handler.dispatchMessage(Handler.java:102)
[ERROR] TiExceptionHandler: android.os.Looper.loop(Looper.java:223)
[ERROR] TiExceptionHandler: android.app.ActivityThread.main(ActivityThread.java:7656)
[ERROR] TiExceptionHandler: java.lang.reflect.Method.invoke(Native Method)
[ERROR] V8Exception: Exception occurred at /PushNotifications.js:51: Uncaught Error: Default FirebaseApp is not initialized in this process . Make sure to call FirebaseApp.initializeApp(Context) first.

Getting an exception : ERR_INVALID_CALLBACK

Trying to run the firebase core module with the following code:
var core = require('firebase.core');

core.configure({
GCMSenderID: '123123123123123',
googleAppID: '1:11111111:android:1111111111', // Sending actual IDs here
});

But it throws an exception, trace as follows:
2019-01-28T14:13:42.566Z | ERROR | Callback must be a function
2019-01-28T14:13:42.566Z | TRACE | TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
at maybeCallback (fs.js:129:9)
at Object.exists (fs.js:197:3)
at SimpleFileCache.persist (/Users/test/Library/Application Support/Titanium/mobilesdk/osx/7.4.2.GA/android/cli/hooks/aar-transform.js:484:11)
at /Users/test/Library/Application Support/Titanium/mobilesdk/osx/7.4.2.GA/android/cli/hooks/aar-transform.js:379:9
at /Users/test/Library/Application Support/Titanium/mobilesdk/osx/7.4.2.GA/node_modules/async/dist/async.js:460:16
at replenish (/Users/test/Library/Application Support/Titanium/mobilesdk/osx/7.4.2.GA/node_modules/async/dist/async.js:977:25)
at iterateeCallback (/Users/test/Library/Application Support/Titanium/mobilesdk/osx/7.4.2.GA/node_modules/async/dist/async.js:967:17)
at /Users/test/Library/Application Support/Titanium/mobilesdk/osx/7.4.2.GA/node_modules/async/dist/async.js:944:16
at /Users/test/Library/Application Support/Titanium/mobilesdk/osx/7.4.2.GA/android/cli/hooks/aar-transform.js:356:12
at /Users/test/Library/Application Support/Titanium/mobilesdk/osx/7.4.2.GA/node_modules/async/dist/async.js:460:16
at nextTask (/Users/test/Library/Application Support/Titanium/mobilesdk/osx/7.4.2.GA/node_modules/async/dist/async.js:5197:29)
at /Users/test/Library/Application Support/Titanium/mobilesdk/osx/7.4.2.GA/node_modules/async/dist/async.js:5204:13
at apply (/Users/test/Library/Application Support/Titanium/mobilesdk/osx/7.4.2.GA/node_modules/async/dist/async.js:21:25)
at /Users/test/Library/Application Support/Titanium/mobilesdk/osx/7.4.2.GA/node_modules/async/dist/async.js:56:12
at /Users/test/Library/Application Support/Titanium/mobilesdk/osx/7.4.2.GA/node_modules/async/dist/async.js:944:16
at updateBuilderWithTransformResult (/Users/test/Library/Application Support/Titanium/mobilesdk/osx/7.4.2.GA/android/cli/hooks/aar-transform.js:352:5)

at /Users/test/Library/Application Support/Titanium/mobilesdk/osx/7.4.2.GA/node_modules/extract-zip-fork/index.js:26:15
at /Users/test/Library/Application Support/Titanium/mobilesdk/osx/7.4.2.GA/node_modules/yauzl/index.js:32:7
at /Users/test/Library/Application Support/Titanium/mobilesdk/osx/7.4.2.GA/node_modules/yauzl/index.js:123:16
at /Users/test/Library/Application Support/Titanium/mobilesdk/osx/7.4.2.GA/node_modules/yauzl/index.js:473:5
at /Users/test/Library/Application Support/Titanium/mobilesdk/osx/7.4.2.GA/node_modules/fd-slicer/index.js:32:7
at FSReqWrap.wrapper [as oncomplete] (fs.js:463:17)

Configuration of the project as follows:
Node : 10.15.0
Titanium SDK: 7.4.2
Appcelerator v 5.0.14
Using firebase.core v 3.0.2 and ti.playservices v11.0.40

java.lang.IllegalStateException at com.google.firebase.FirebaseApp.getInstance

Hello,

Thanks for developing this module, we are successfuly using it for push notifications and firebase statistics. Checking Google Play Console, its giving a high crash rate for us (>2%) with the following error:

java.lang.IllegalStateException: 
  at com.google.firebase.FirebaseApp.getInstance (Unknown Source)
  at com.google.firebase.iid.FirebaseInstanceId.getInstance (Unknown Source)
  at com.google.firebase.iid.FirebaseInstanceIdService.zza (Unknown Source)
  at com.google.firebase.iid.FirebaseInstanceIdService.handleIntent (Unknown Source)
  at com.google.firebase.iid.zzc.run (Unknown Source)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1113)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:588)
  at java.lang.Thread.run (Thread.java:818)

You may have any idea what is causing this error?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.