flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

☂️ Support for Background Isolates

Open Lyokone opened this issue 2 years ago • 9 comments

This umbrella issue describes the current support of Background Isolates (announced as of Flutter 3.7) with FlutterFire.

The current implementation of Background Isolates only supports Flutter->Host and not the other way around. It means plugins that need to communicate back to Flutter will not work yet with Background Isolates.

Current support:

🚧 cloud_firestore (works but some errors when hot reloading, no support for subscribing to documents) ✅ cloud_functions ❓ firebase_analytics ❓ firebase_app_check ❓ firebase_app_installations 🚧 firebase_auth (some functions not available - verifyPhone) ✅ firebase_core ❓ firebase_crashlytics 🚧 firebase_database (works but some errors when hot reloading, no support for subscribing to documents) ❌ firebase_dynamic_links ❓ firebase_in_app_messaging ❓ firebase_messaging ❓ firebase_ml_custom ❓ firebase_ml_model_downloader ❓ firebase_ml_vision ✅ firebase_performance ❓ firebase_remote_config ❌ firebase_storage

Legend:

❓ = Not yet tested ✅ = Works 🚧 = Works partially ❌ = Doesn't work

Lyokone avatar Jan 31 '23 09:01 Lyokone

How to know if it doesn;t work, is there any error occured?

ariefwijaya avatar Jan 31 '23 17:01 ariefwijaya

@ariefwijaya Yes, if it doesn't work, you'll get an error.

Lyokone avatar Feb 01 '23 08:02 Lyokone

Oh, sorry but I tried and firebase_storage worked in isolate. I use it to download file using await firebaseStorage.refFromURL(url).writeToFile(existFile); @Lyokone

ariefwijaya avatar Feb 02 '23 03:02 ariefwijaya

@ariefwijaya Did you try with RootIsolateToken?

Lyokone avatar Feb 02 '23 08:02 Lyokone

@Lyokone I'm using WorkManager to work in isolate

ariefwijaya avatar Feb 02 '23 09:02 ariefwijaya

@ariefwijaya As pointed in the issue, this thread is for tracking support of Flutter own Background Isolates

Lyokone avatar Feb 02 '23 09:02 Lyokone

Is it planned to add documentation regarding available features to pub.dev of the packages or any other place? I couldn't find it anywhere in the official documentation and it's currently a process of trial and error to figure out what works in the background.

timsauvageot avatar May 15 '23 12:05 timsauvageot

Currently, we rely on both ways communication. As long as Flutter will not provide communication from the host to Flutter, it will probably stay in this state.

Lyokone avatar May 15 '23 12:05 Lyokone

Currently, we rely on both ways communication. As long as Flutter will not provide communication from the host to Flutter, it will probably stay in this state.

I understand the underlying issue but this doesn't seem to be documented anywhere in the Flutter packages.

timsauvageot avatar May 15 '23 12:05 timsauvageot