How to communicate with Firebase database form Android Things using a service account - firebase

I have an Android client and an Android Things server application sharing a Firebase database. How can I communicate from the Android Things application with the Firebase database using a service account? Following the instructions below results in a Gradle error.
https://firebase.google.com/docs/admin/setup
Gradle error
Error:(56, 0) Version: 5.8.0 is lower than the minimum version (9.0.0) required for google-services plugin.

You've got several things going wrong here.
First, you don't need a service account to deal with Firebase services from within an Android Things app. You deal with Firebase just like you would a normal Android app as a client of the Firebase service. There is literally almost no difference in how you interface with Firebase from this perspective.
Second, don't use firebase-admin in an Android app. That's for server-side code. Use the normal Firebase client SDKs for Android.
Also bear in mind that Android Things Developer Preview 0.6.1 has Play Services 11.6.x on it, and it doesn't self-update like normal Android devices. This means you have to use the 11.6.0 Firebase and Play SDKs in your Thing app. If you try to use newer versions, the client will fail because the client SDK versions aren't matched by an equal or better Play Services APK on the device.

Related

Packaging a cross-platform electron app with firebase auth

I am trying to follow the firebase-electron guide instructions documented in the readme file here:
https://firebaseopensource.com/projects/david-asher/electron-firebase/#create-a-firebase-project
But I eventually get to a step which says
It is highly recommended that you add firebase-config.json to your .gitignore file. It contains project-specific information that you do not want to check in with the app, nor should it be packaged when building your app.
I was planning on releasing my electron app on the mac / windows / linux stores. And if firebase-electron needs the firebase-config.json file variables, then is there no way to release my electron app with authentication using firebase?
My end goal is to release an electron app with login capabilities that can work on both an electron app and browser. Specifically the YouTube API for uploading videos in node.js which requires a request to be made using the user's auth token (which you can get signing in through google using firebase, but can I release an app with firebase?)
Or maybe is there a better solution / example

Cordova Firebase Remote Config Plugin vs. Web SDK

Firebase recently announced remote config for their web SDKs. In an app built with Cordova or Ionic, is there any feature that would justify using the cordova plugin for remote config instead of using the firebase sdk?
For example, I think that in the case of firebase analytics, it's better to use the cordova plugin because it's able to detect events such as app open and app close and I think the web sdk will not be able to track these events.

Does firebase realtime database unity package supports Universal Windows platform build?

I am using firebase realtime database, to send my score to server. It worked like charm for Android and iOS. However when i created build for universal windows platform, its not allowing me to crate build. So i removed firebase from my project and created build. Apart from score management, everything worked fine. So i am just surprised, does firebase supports universal windows platform build.
https://firebase.google.com/docs/database/unity/start?hl=en#configuring_the_sdk_for_the_unity_editor
You can use firebase realtime database in unity editor.
So it might be possible.

Can't init firebase on iOS in Unity without having an Android project

I've tried initializing Firebase on Unity for iOS app only, and I'm getting this error while running:
Unable to load options for default app ([/Users/yaniv/Downloads/21312111222/New Unity Project333/Assets/StreamingAssets/google-services-desktop.json, /Users/yaniv/Downloads/21312111222/New Unity Project333/Assets/StreamingAssets/google-services.json] are missing or malformed)
I know that for cross-platform apps, I usually download the google-services.json from the Firebase project settings, but in this case, I have no Android apps under this project (it's an iOS app only).
How can I prevent Firebase from request it?

Do I need to operate my own server to user Firebase Admin SDK

I have a Firebase project for android and am interested in using the Admin SDK, but it seems like this would require operating my own server. I don't want to have my own server operating 24/7 just for my app to work. Do you need to have a server to use the Admin SDK?
Thanks
You can't use the admin SDK in the app, so you need some other environment to run it. That could be your desktop, laptop, a server, Cloud Functions, or some other cloud-based service. Just not the app.

Resources