Reputation: 1
In Firebase DataBase when saving data to the database if it is online it triggering onComplete method from CompleteionListener
But when mobile is working offline when data save its not triggering onComplete method.
Can anyone help me out
Upvotes: 0
Views: 117
Reputation: 789
As the Firebase Docs for the CompletionListener state:
"This interface is used as a method of being notified when an operation has been acknowledged by the Database servers and can be considered complete"
This means that the Completion listener only triggers, once your mobile device comes back online and syncs the data to firebase.
As a workaround you could add a ChildEventListener, where the onChildChange method notifies you once a child has been changed, meaning your write to your local d
Upvotes: 1