gpt4 book ai didi

firebase - Flutter Firebase 身份验证

转载 作者:IT王子 更新时间:2023-10-29 06:37:41 25 4
gpt4 key购买 nike

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

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com