Linked Questions

Popular Questions

I was executing the following code triggered by receiving FCM in the background using firebase_messaging.

Future<LatLng> fetchCurrentLocation() async {
  final currentLocation = await Geolocator.getCurrentPosition();
  return LatLng(currentLocation.latitude, currentLocation.longitude);
}

And, this was running without any issues, but it has stopped running since a little while ago. Specifically,

final currentLocation = await Geolocator.getCurrentPosition();

It stops at this point and the execution resumes when transitioning from the background to the foreground.

Since it was working before, it's puzzling why it's no longer working.

How can I make it work in the background as well?

final currentLocation = await Geolocator.getCurrentPosition();

Is it possible to make it run?

Related Questions