小编Paw*_*ski的帖子

[Firebase/Core][I-COR000003] 尚未配置默认 Firebase 应用

我已在我的本机 iOS Swift/ObjC 应用程序中安装了这三个 pod:

pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'Firebase/Analytics'
Run Code Online (Sandbox Code Playgroud)

这是配置方法的调用:

func application(_ application: UIApplication,
                 didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
    FirebaseApp.configure()
    return true
}
Run Code Online (Sandbox Code Playgroud)

我在日志中有这样的消息:

[Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your application initialization. Read more: https ....
Run Code Online (Sandbox Code Playgroud)

我不知道问题出在哪里。我在互联网上看到类似的内容,但与以下技术相关:React Native、Cordova、Flutter ...有人知道我的本机项目中发生了什么吗?

我在控制台中仔细检查了 Google Info Plist 文件和配置,以前从未出现过此类行为。

Xcode 版本11.2.1 (11B500)

ios firebase

5
推荐指数
1
解决办法
6802
查看次数

可编码的 Swift 4

我不确定如何使用 codable 解码情绪字段,由于这个 JSON 的结构对我来说很复杂......我只需要解析情绪字段。

{
    "image_id": "HvRRq86gYY96sVNP+lXHYg==",
    "request_id": "1525001300,f1cf060a-dbba-424a-ad75-c315298bbadb",
    "time_used": 444,
    "faces": [
        {
            "attributes": {
                "emotion": {
                    "sadness": 13.562,
                    "neutral": 86.409,
                    "disgust": 0.001,
                    "anger": 0.003,
                    "surprise": 0.002,
                    "fear": 0.022,
                    "happiness": 0.001
                }
            },
            "face_rectangle": {
                "width": 800,
                "top": 451,
                "left": 58,
                "height": 800
            },
            "face_token": "75985eed763e1a7cc9aad61c88f492a1"
        }
    ]
}
Run Code Online (Sandbox Code Playgroud)

parsing json key ios swift

3
推荐指数
1
解决办法
1250
查看次数

标签 统计

ios ×2

firebase ×1

json ×1

key ×1

parsing ×1

swift ×1