I have tried to isolate the problem- on my main page, I added this code to test.
void deleteMe() {
FirebaseDatabase.instance
.reference()
.child(
"users")
.onValue
.listen((Event user) {
print("user = " + user.snapshot.value.toString());
}).onData((Event event) {
print("Event = $event");
});
}
@override
void initState() {
deleteMe();
_ensureLoggedIn();
super.initState();
}
If I run flutter run -d --release, and update a user's information in the database, log messages are only shown when I am in the app. When I leave the app, and then change values in my firebase database, I see no log messages- but when I open the app again they are printed. This is not the case when I run in debug mode.
This is all for iOS so far.
Why does my listener stop listening when I leave the app, only in release mode?