android - Firebase Database listeners not firing after a while while authenticated -
i'm making app , i've run problem firebase's database , authentication services.
after while, while authenticated (using firebase auth) , using app, database valueeventlisteners don't seem called, though there is data in database.
how i'm adding listeners:
firebasedatabase .getinstance() .getreference() .child("my_child") .addvalueeventlistener(new valueeventlistener() { @override public void ondatachange(datasnapshot datasnapshot) { log.d("app", "ondatachange"); } @override public void oncancelled(databaseerror databaseerror) { } });
stuff i've tried:
- checking database rules (after relog reading fine - simulated reads pass while authenticated & unauthenticated)
- keepsynced(true) on databasereferences
- adding listeners in activity's oncreate instead of application's oncreate
- adding/removing/updating data in database trigger sync
- rebooting
any appreciated.
so, apparently issue api called "token service" not enabled in google apis dashboard.
helpful email firebase support (thanks guys!), i've turned on debug logging calling firebasedatabase.getinstance().setloglevel(logger.level.debug);
lo , behold: d/persistentconnection: pc_0 - error fetching token: internal error has occurred. [ �token service api has not been used in project <project-id> before or disabled. enable visiting https://console.developers.google.com/apis/api/securetoken.googleapis.com/overview?project=<project-id> retry.
so enabling api, seems have fixed error!
Comments
Post a Comment