Comments (9)
Yep the current recommendation is to select web as a platform to generate the DefaultFirebaseOptions for, and then instead of DefaultFirebaseOptions.currentPlatform
you can use DefaultFirebaseOptions.web
from flutterfire_desktop.
Or even more flexible:
bool needsWeb = Platform.isLinux | Platform.isWindows;
await Firebase.initializeApp(
options: needsWeb
? DefaultFirebaseOptions.web
: DefaultFirebaseOptions.currentPlatform,
);
from flutterfire_desktop.
Windows and Linux aren't supported in Firebase Console.
Currently since the desktop packages under the hood use Identity Platform REST API, Web configurations can be used, but considering the CLI seems to be reading the current platform so it throws this exception.
@Salakar this is interesting case to think about for FF desktop
from flutterfire_desktop.
@Salakar works. Thanks a lot!
from flutterfire_desktop.
Yep the current recommendation is to select web as a platform to generate the DefaultFirebaseOptions for, and then instead of
DefaultFirebaseOptions.currentPlatform
you can useDefaultFirebaseOptions.web
Can you elaborate on this?
My current Firebase initialization looks like this:
// Init Firebase
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: Platform.isLinux ? DefaultFirebaseOptions.web : DefaultFirebaseOptions.currentPlatform,
);
from flutterfire_desktop.
Just to clarify, macOS is included, as mentioned in the README
the plugin will override macOS implementation as it's currently being used for development purposes.
from flutterfire_desktop.
Hi, all, tried the solutions mentioned in this solution, but it does not work for flutter apps (for linux) with flutter version (3.10.6 - stable), firebase_core (2.15.0) and cloud_firestore (4.8.4).
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
#0 FirebaseCoreHostApi.initializeCore (package:firebase_core_platform_interface/src/pigeon/messages.pigeon.dart:210)
#1 MethodChannelFirebase._initializeCore (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:29)
#2 MethodChannelFirebase.initializeApp (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:73)
#3 Firebase.initializeApp (package:firebase_core/src/firebase.dart:43)
Just wondering any timeline to officially support this for Linux/Windows?
Cheers
from flutterfire_desktop.
Have you taken a look at this package?
https://pub.dev/packages/firebase_core_desktop
from flutterfire_desktop.
I tried with firebase_core_desktop, the UI can be displayed on Linux, however, it failed to fetch data from firestore. the function snapshots() won't be able to be called. See the message below:
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method Query#snapshots on channel plugins.flutter.io/firebase_firestore)
#0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:308:7)
#1 MethodChannelQuery.snapshots. (package:cloud_firestore_platform_interface/src/method_channel/method_channel_query.dart:150:28)
from flutterfire_desktop.
Related Issues (20)
- 🐛 [firebase_auth_desktop] For recaptcha its asking to upgrade supported browser HOT 2
- 🐛 [firebase_auth_desktop-1.0.1]Multiple Errors HOT 1
- 🐛 [firebase desktop auth]Recaptcha issue HOT 5
- 🐛 [firebase_auth] type 'DateTime' is not a subtype of type 'int' when trying to read IdTokenResult.expirationTime HOT 4
- 🐛 Error when building linux application HOT 3
- [📚] Your documentation feedback title (CHANGE ME)
- 🐛 [firebase_core_desktop] Update dependences due crashlitycs update
- 🐛 [firebase_auth_desktop] Update dependences due crashlitycs update HOT 1
- Dependency Issue while installing firebase_auth_desktop HOT 2
- 🐛 [firebase_core_desktop] No implementation found HOT 1
- firebase_auth_desktop throws UnimplementedError on tenantId
- 🐛 firebase auth throw UnimplementedError
- 🐛 [firebase_auth_desktop: ^1.0.2] reCAPTCHA failed in windows HOT 1
- 🐛 [firebase_auth_desktop] Dependency issues HOT 10
- 🐛 [FIREBASE_CORE_DESKTOP] Not compatible with firebase messaging
- 🐛 [flutter_fire_auth] The method 'FallThroughError' isn't defined for the class 'ActionCodeInfo'
- 🐛 firebase_auth_desktop signIn error on Windows: Bad state: No element HOT 1
- 🐛 [firebase_auth_desktop] Unable to run `pod install` for macOS example HOT 1
- 🐛 [firebase_auth_desktop] project has build error because of new Firebase updates HOT 2
- 🐛 [firebase_auth_desktop] build error MSB3037 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutterfire_desktop.