小编fra*_*iga的帖子

使用 FirebaseApp.configure(options:) 时无法找到配置文件 GoogleService-Info.plist

在我的项目中,我对具有不同配置(生产/暂存/质量检查)的同一应用程序有不同的目标。根据Firebase 文档的建议,我plist为每个目标添加了一个文件,并通过以下方式传递正确的配置文件来初始化 FirebaseApp:

let configPath = Bundle.main.path(forResource: NAME_OF_PLIST_FOR_CURRENT_TARGET ofType: ".plist")!
let options = FirebaseOptions(contentsOfFile: configPath)!
FirebaseApp.configure(options: options)
Run Code Online (Sandbox Code Playgroud)

我还按照此处GoogleService-Info.plist文档中的建议从项目中删除了该文件,以确保可靠的分析报告。

当我在控制台中运行该应用程序时,我看到这些消息。

[Firebase/Core][I-COR000012] Could not locate configuration file: 'GoogleService-Info.plist'.
[Firebase/Analytics][I-ACS020006] Google App ID from GoogleService-Info.plist is empty. Please, define GOOGLE_APP_ID in GoogleService-Info.plist for Analytics to work reliably. See
[Firebase/Analytics][I-ACS025020] Analytics requires Google App ID from GoogleService-Info.plist. Your data may be lost. Google App ID has been changed. Original, new ID: (nil), MYAPPID 
Run Code Online (Sandbox Code Playgroud)

难道我做错了什么?此配置是否会导致分析丢失?(如控制台消息所示)

ios firebase firebase-analytics

5
推荐指数
2
解决办法
2万
查看次数

设备重启后未发送 iOS 静默推送通知

在测试向我的应用程序发送静默通知(一个在有效负载中具有“内容可用”:1 的通知)时,我注意到,在设备重新启动后,不会发送通知。如果应用程序在后台或前台运行,则发送相同的有效负载有效,但在设备重新启动后,我没有收到didReceiveRemoteNotification:回调AppDelegate

这在 iOS 13 和 iOS 12 上都会发生

apple-push-notifications ios silent-notification ios13

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