I can give you some suggestion.
Map the data from firebase to sqlite. Since sqlite is not schema less db you will need to store the data as JSON.stringify from firebase data. You can not search the stringified json however so you will need to create columns from the firebase data that you want to search locally in addition to the the JSON data you store as string in another column in same table to sync back to server.
Every change you make to the data will change the columns locally in the table and also in the json.parse of the data you have saved as string in the table.
You can make a new table locally that will keep these changed data objects along with the reference to the firebase DB,
You can create an observer that keep track of any addition to this table and anytime there is data in this table you use the firebase ref saved along with data and use it to update server if user online. On success callback remove this row from the table locally so that you don’t sync this up again in future.
You can also create observer on firebase tables to sync down to local table same way if new child is added on server from another client device.
This is one logic I have used but I am sure there can be some other flow too,