1

In my java android app I'm recording with the firebase analytics some events that the user watches in the app, like every time the user watch an item. I would like to retrieve this data to, for example, show the user the yesterday's top most watched items. How can I achieve that?

The only information that I can find is to retrieve data from the firebase database which I'm not using. Can someone point me in the right direction?

Thanks

villb
  • 195
  • 3
  • 8

1 Answers1

0

Just had a quick look at the below docs

https://firebase.google.com/docs/analytics/

I can't see a "get" method for receiving data. :( So I don't think they offer it right now.

You could get the same result by using the Real-Time Database.

set the value with something like: (the below is javascript but the idea will be the same)

            // get next ID
            id = Firebase.database().ref().child("users").push().key;

            // get all users
            const users = Firebase.database().ref().child("users");
            var userOBJ = {};


            users.on('value', function (snap) {
            userOBJ[id] = {username: ..., watch_item:1234 });
            users.update(userOBJ);

To get the object data

dbOBJ = Firebase.database().ref().child("users").child(id);
dbOBJ.on('value', function(snapshot){

    snapshot.val();

});
Chris Evans
  • 845
  • 1
  • 13
  • 29