firebase - Flutter Firebase 身份验证

标签 firebase flutter dart firebase-authentication

我正在开发 flutter 应用程序,并在项目中添加了 firebase 身份验证。 它运行良好,但是当应用程序加载时,控制台会这样说。 这是正常行为吗?谢谢!

    5.4.1 - [Firebase/Core][I-COR000003]
 The default Firebase app has not yet been configured.
 Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift)
 to your application initialization.

最佳答案

检查 configuration of IOS在 flutter 中。然后创建一个Podfile , 在该文件中添加以下库以便能够使用 Firebase 身份验证:

pod 'Firebase/Core'
pod 'Firebase/Auth'

然后转到这个路径 flutterApp\ios\Runner\AppDelegate.m 并导入和配置 firebase:

#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"

@import Firebase; // new

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

//configure firebase
[FIRApp configure]; // new

[GeneratedPluginRegistrant registerWithRegistry:self];
// Override point for customization after application launch.
return [super application:application didFinishLaunchingWithOptions:launchOptions];

  }

@end

关于firebase - Flutter Firebase 身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51578278/

相关文章:

android - 如何删除从 FirebasePerformance 开始的跟踪

android - 如何提高 flutter 中文本动画的速度?

Flutter 在气泡聊天消息上对齐时间戳文本

flutter - 通过pubspec.yaml从内部存储库中提取依赖项

javascript - Firebase RememberMe 功能

javascript - 为什么使用 Schedule/onRun 触发器运行相同的 Firebase 函数需要比使用 HTTP onRequest 触发器运行 10 倍的时间?

javascript - 优化在 Firebase Firestore 中检索按另一个集合分组的数据

flutter - 命名路由如何在 flutter web 中具有 URL 参数?

dart - Dart:在WebStorm中无法调试Dart应用,运行正常

flutter - RangeError(索引):无效值:有效值范围为空:1