Get data entry count using firebase analytics - android

I am new to Firebase Analytics and I went through some online tutorials to learn about it. I have a simple 'Notes' app (Android) in market, which allow users to create and save notes offline on their device.
It would be great, if I could get a total number of notes that have been created till date with my app. I know, I can add an event which will notify Firebase when user creates a new note, but what about the existing notes that are present in the database?
Is there any way to get such statistics through Firebase Analytics?
UPDATE:
I have included a user property as notes_count, but I am not able to find a way to see the total. How to do it?

You could set a user property with the number of notes the user has created instead of or in addition to logging the event. You are limited to 25 different user properties total though, so use them with care.

Related

Android Google Firestore Notify user app that there is new data in Firestore

I am building an android app that uses both Room and Firestore.
The app will have a long list of items that are stored in Firestore. When the user first launches the app the app will read all the items from the Firestore and store them in Room and from then on the users app will read the item list from Room.
Now, this item list will change but only about once a month so I need a system where I can update the list in Firestore and then send a message to all users that the items list has changed. They must then do a one time fetch to get the updated items list from Firestore and write it to Room.
Using Firestore listener is not an option as this will result in hundreds of unnecessary reads every time a user opens the item list activity.
Also Firebase Cloud Messaging only seems to be recieved by users whos apps are online.
Is there a way to notify all users apps (even those that are offline) that the data set has changed and that they must execute a fetch and retrieve the updated item list?
Is there a way to force users to check for new messages from Firebase Cloud Messaging whenever the app starts so they can get the updated item list?
Instead of using FCM to serve this information, I would integrate a "list" version number into a document that is accessed whenever you start up the app.
For example, it's common to have a service status document (such as /global/status) that contains important meta information such as latest application versions for your mobile apps (to show "Please update" messages), information about upcoming outages or links/IDs to blog posts that you use to serve news/messages to your users.
If you have a suitable document, you would add an entry for "listVersion" that could be a timestamp, a version number or the like. If using a version number, you have the added benefit of being able to use semantic versioning and give it special meaning. Update immediately for major changes, prompt the user to update their database (if on mobile data) for minor changes and maybe update only over WiFi in the background if it's only a patch (such as fixing a typo somewhere). To mix the version number with a timestamp, just use the year and month as the major and minor versions and keep the patch number as is (e.g. v2019.11.28). The meaning of each version is up to you as how you are updating the list and it's purpose is not known.

Creating groups with Firebase Realtime Database in Android app

I have an Android app that uses the Firebase Realtime Database. At the moment it is a single user app, in that when a user logs in, using Firebase Auth, the data they create is kept private to them. What I need to do for the next phase of the project is to allow for the creation of teams or user-groups that have access (read and write) to the data currently created by a single user.
The database structure and rules for doing this are understood, however, the issue I have is how to create the groups.
I did find the following blog and it is very close to what I need, it does not make clear how a new user would create the pending membership entry in a specific "chat" (this is a group chat sample).
https://firebase.googleblog.com/2016/10/group-security-in-firebase-database.html
Any points on resolving this final issue would be much appreciated.
Sid
Just simply create groups like below
|--Groups
|---group1
|-----uID1 - owner
|-----uID2 - participant
|-----uID3 - participant
..............
follow this https://firebase.googleblog.com/2016/10/group-security-in-firebase-database.html link. There are example groups and rules. It will help for u to proceeds it.
Follow this https://firebase.google.com/docs/database/ios/structure-data to make good structure of data to increase performance

firebase how many current logged in user in my app

So i have app with Firebase email Auth
I want to keep track of how many users are actively logged in right now
A number in firebase database that can keep changing or list of active users right now!
They are removed moment user logs out
We cant exactly do addition in firebase database so how to do that.. any help?
PS: I dont want to use Analytics, i want a database solution
You need to use firebase StreamView : RealTime Analytics
Below are the details
https://support.google.com/firebase/answer/7229836?hl=en
http://firebase.googleblog.com/2017/03/realtime-analytics-for-everyone.html
For real hardcore database solution you can do the following:
You can add a last_login field in your database users collection. Update that field whenever a user resumes your app. Then you will be able to query once or Live Stream about how many users are logged in the last several minutes.
If you are looking for something much more accurate you can update the user last_login every several seconds from your application and Live Stream the last results.
Note that this may cost you a lot of money since firestore is a pay per action database, Which means that you pay for each update and each read from your database.
You can also checkout #Frank van Puffelen comment bellow your answer.
Enjoy!

What is most simple way to send notification of unexpected events to users of Android application?

For example I expect this kind of situation: data in my application lost relevance and so it usless until update. And until update it have to show users some predefined message.
Is here any simple and free solution to this task?
Guess I can use some server to somehow send simple messages... but it sounds way too complicated.
If this is important I use Xamarin.
Update: main difficulty here is fact - my application can't in any way define if it's outdated or not. This may happen in random moment.
Although the requirement is not very clear I assume Update here means app update.
each time user launches app make call to an api on ur server to check if user needs to update app
If that returns true take user to a static view that says app needs update and redirects user to google play to install updates
If you want to avoid using a server, you should try Firebase (https://firebase.google.com/). More specifically, you should use Firebase Remote Config (https://firebase.google.com/features/remote-config/).
Define in a key-value pair of something like minimum_app_version_required in Firebase Remote Config. Every time user opens the your app, compare the values of app version and minimum_app_version_required that you are getting from Firebase console and show a dialog box accordingly. You can also change the value of minimum_app_version_required anytime you want.
Just set some internal flag. That when that situation occurs, you can set the flag to true and just edit whatever layout element you are using such as listView or any other element with your predefined messages saved in strings.xml. You can also build any custom pop up screen, depends how you want to show them. Let me know if you didn't understand or exactly how you want?
Need to implement versioning for this problem. To achieve this, you have to maintain a version number in server, this is the version number you app will have to save and use it to validate with server. If both are not same, then app will get the latest data from the server.

Firebase Analytics - Add custom keys in device_Info or geo_info

I have been using Firebase Analytics for quite some time now and I wanted to know if we could add or modify some specific keys (other than userId) in the analytics data visible on BigQuery? The reason I'm asking this is so I can map my old users to the new users on Firebase.
Looking at the analytics data on BigQuery, inside device_info there is a key device_id whose value I always found null. I want to modify this value as I was previously setting it for my old users. This would help migrate users from my old analytics db to Firebase. Not only the device_info, can I modify/add new key-value params in the other dimensions too?
All help is appreciated.
device_id in device_info is only populated on iOS platform with the IDFV, if IDFA is not available. It is not used for the Android platform.
https://support.google.com/firebase/answer/7029846?hl=en
There is no support for overriding these values that I'm aware of.
Meanwhile, if you have access to, say, the resettable_device_id, you might be able to use that to join in other data you have for the old users in BigQuery.

Categories

Resources