I am trying to run a query on the firebase database and if the user is offline I want to display a pop up to the user prompting them to try again. However the query does not return when offline.
databaseRef.queryEqual(toValue: "someValue").observeSingleEvent(of: FIRDataEventType.value, with: { (snapshot) in
print(snapshot) //this is never called when user is offline
}) { (error) in
print(error) //neither is this
}
What is the best strategy to run this query and detect if the user was offline?