Flutter Firebase身份验证

时间:2018-07-29 07:38:06

标签: firebase firebase-authentication flutter

我正在开发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.

2 个答案:

答案 0 :(得分:3)

检查抖动中的configuration of IOS。然后创建一个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

答案 1 :(得分:1)

我在使用Firebase时遇到了类似的问题,结果我没有在iOS模块的Info.plist中包含配置