Firebase (3.x) offline data?

I would like to use my Firebase 3.x data stored inside FB database offline. I use ionic, firebase and angularfire libraries.

I have online data working using FB, this is proof-of-concept of the simple app:

What I need: data are stored in FB and in local db on android phone. The app normally uses local db (even if phone is online). I need to synchronise local db and FB db. How…?

I know FB implements “offline mode” when it loses connection; but power off and on phone and changes lost.

Any sugestion?