[英]Firebase Authentication in both Embedded Flutter app and Native Android
I have been working on a native Android app written in Java for some time now.一段时间以来,我一直在研究用 Java 编写的原生 Android 应用程序。 The app uses Firebase Authentication and Cloud Firestore, with virtually all app functions depending on this.该应用程序使用 Firebase 身份验证和 Cloud Firestore,几乎所有应用程序功能都依赖于此。 Users are asked to sign in near the startup of the app.要求用户在应用程序启动时登录。
I recently learned about the Flutter cross-platform framework and I am interested in writing new features/UI components of the Android app in Flutter in order to eliminate iOS development down the line. I recently learned about the Flutter cross-platform framework and I am interested in writing new features/UI components of the Android app in Flutter in order to eliminate iOS development down the line. However, I want to avoid rewriting the entire app in Flutter for now to save time.但是,我想暂时避免在 Flutter 中重写整个应用程序以节省时间。
Since new UI components would require users to be authenticated and using cloud firestore, is there a way to authenticate the user on both the embedded Flutter app and the existing native Android at the same time, without requiring them to sign in on each?由于新的 UI 组件需要用户进行身份验证并使用云 Firestore,有没有办法同时在嵌入式 Flutter 应用程序和现有的本机 Android 上对用户进行身份验证,而不需要他们分别登录?
The FlutterFire libraries wrap the native iOS and Android SDKs provided by Firebase. FlutterFire 库封装了 Firebase 提供的原生 iOS 和 Android SDK。 So if the user is authenticated in iOS/Android already, the Flutter code should pick that up automatically.因此,如果用户已经在 iOS/Android 中进行了身份验证,则 Flutter 代码应该会自动选择它。
If you're having trouble making this work, post a new question with the minimal complete/standalone code that reproduces that problem .如果您在完成这项工作时遇到问题,请使用重现该问题的最少完整/独立代码发布一个新问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.