Is it possible to change Firebase Analytics User Properties from a backend? - firebase

Overview: I would like to send targeted push notifications in my Native Mobile App by using the segmentation offered by Firebase. The way I would like to configure this segmentation is by leveraging on custom Firebase Analytics User Properties, like specific preferences or other business specific parameters.
I've seen that is possible to update User Properties by means of the Firebase SDK and through them I will update a "custom ID" user property which helps me identifying my users; on the other side I would like to update other user parameters, which should help me segmenting users, through a backend process.
The Problem: is that I've not found how to update User Properties from a backend side, like through APIs or something like that.
Have someone figured out to implement this scenario?
Thanks

There is no server-side or REST API for Google Analytics for Firebase at the moment.
The two options that I know of:
Send the properties from your server to the client, and use the Firebase SDK on the client to get those properties in to Analytics.
Hook your Firebase analytics up to BigQuery, store the additional information from your server into BigQuery too, and then join then in your own analysis.

Related

Firebase RISC API integration

I'm using sign in with google via firebase, but I'd like to register a custom receiver (https://developers.google.com/identity/protocols/risc#register_your_receiver) to detect Security Events (https://developers.google.com/identity/protocols/risc#handle_events)
As reported in the errors table here https://developers.google.com/identity/protocols/risc#error_codes
403 "Existing stream configuration does not have spec-compliant
delivery method for RISC." -> "Your Google Cloud project must already
have a RISC configuration. If you are using Firebase and have Google
Sign-In enabled, then Firebase will be managing RISC for your project;
you will not be able to create a custom configuration. If you are not
using Google Sign-In for your Firebase project, please disable it, and
then try to update again after an hour."
I undestand that Firebase manage RISC for my project. Does it means that I cannot detect security events with custom receiver?
Is there any way I can intercept these events via Firebase?
Thanks
I contacted Firebase support team and they said that unfortunately, at the moment, there's no way to intercept these events using Firebase Authentication, it could be a new feature.

Unknown user in my firebase user authentication (Flutter/firebase)

I developed an app to test the google login feature using flutter and google authentication. The project is a closed project and only I have access to it. But recently I saw that there was a google sign in from an unknown Email ID. How did the user login without the build of my app? Has my account been hacked? What is going on?
Anyone with knowledge of your project's API Keys can access your Firebase Project using simple CURL Commands.
This is why it's a good idea to add restriction to those API Keys
In case you haven't, go to https://console.cloud.google.com and
Select your project
Click the menu icon at the top left (hamburger icon)
Go to API & Services and then credentials
You can view the APIs for your Google Cloud Project (linked to your Firebase Project) and then set restrictions for the API keys, refresh them or restrict access to specific platforms like Android or iOS.
You can also set restrictions on which components of Firebase the API key is allowed to access. For example, if your project doesn't require the use of Cloud Firestore, you can ensure that the API Key cannot be used to make calls to the Firestore Database
All said and done, I would still recommend that you shoot a mail to the Firebase Support team at https://firebase.google.com/support/troubleshooter/contact
To anyone still wondering about this:
If you provide a native google sign in and the registered
email adresses look like this:
karolynmccorkle.91842#gmail.com
normabrock.69306#gmail.com
guillermogeorge.53163#gmail.com
kylegomez.35423#gmail.com
opalbarrett.09499#gmail.com
they are probably test accounts used to generate Google Plays Pre-Launch reports.
You can read about it in the Play Console Help here.
If your app has a sign-in screen and you want the crawler to test the
sign-in process or the content behind it, you need to provide account
credentials.
Note that you do not need to provide credentials if your
app supports "Sign-in with Google,” which enables the crawler to log
in automatically.

Can bigquery or Firebase analytics data acessible from ios app side programmatically?

I have Firebase analytics data and enabled BigQuery. But I have a requirement to validate the number of events and screens at app side under automated UI testing. Anyway to access and validate the Firebase analytics data at ios app side programmatically either in swift or objective c?
There is no API to retrieve Google Analytics data through Firebase. See Can I get firebase analytics data using query?
There is also no API for BigQuery to allow secure access directly from your client-side app. That would be a significant security risk, as you'd be exposing data about all of your users to all of your users.
The usual way to implement functionality is to create a custom endpoint (either using a server you already have, or Cloud Functions for Firebase) that exposes just the information your clients need access

How can one fetch the authorized users along with their details in Firebase

I have a Firebase project, which I'm currently using with android. I need to programmatically fetch details of the users authorized along with the UID, Email, etc. Exactly the way it is shown in firebase (with the search), this web portal will be given to the vendor or the person using it to verify the user's authenticity.
I've attached the screenshot from Firebase, I'm hoping to replicate it the same way with the search. If this is possible, how do I go about doing this?
It's not possible to list users from an Android app, using only the Firebase Authentication SDK. You can list users using the Firebase Admin SDK, but that can only be run on a backend you control, using service account credentials for your project.
It might be easier if you store user info in a database, to be queried by client code, rather than try to have your app try to access auth data directly.

How can I access user data stored in Firebase using Google Assistant?

I have some user data stored in Firebase in users/userID/data
I'm using Dialogflow to recognize for example the following intent:
retrieve my email
which triggers a webhook and passes as parameter email, which is the data the user wants to retrieve. How to I pass the firebase userID? I guess I need to implement some kind of logging for the Google Assistant, but I cannot find how can I link the Firebase user account to google actions and how would I get this firebase userID
Is there a standard or recommend way to achieve this?
There is no pre-built solution for this right now.
You will need to implement Account Linking with the Google Assistant.It was done this way to give you, and your users, maximum flexibility. You'll be able to authenticate them using a variety of methods, not just Google Auth, and users are able to use a Google identity for you that may be different than the one they use for the Assistant. Account Linking will associate them without revealing to you which account they use on the Assistant.
This means creating an OAuth server that lets users log in using their Firebase account and issuing tokens to the Assistant. Google does provide some information about the procedure you should follow when creating your OAuth server, and you should be able to create this using Firebase Hosting and Firebase Cloud Functions.
Then, each time the Assistant calls your action, it will send the tokens back to you. You would use this token to determine the Firebase userid and then can look them up in the database.

Resources