I am following the setup https://www.raywenderlich.com/18579842-firebase-analytics-getting-started
I am using flag -FIRAnalyticsDebugEnabled
I view the real-time result in Firebase Analytics Debug View
I also check the console output of XCode.
However, I notice that, if I write my code in the following way
Not receiving any Firebase analytics event
import Firebase
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
return true
}
But, if I write the code in the following way
Receiving Firebase analytics first_open event
import Firebase
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
let title = "xxx"
Analytics.logEvent(AnalyticsEventSelectContent, parameters: [
AnalyticsParameterItemID: "id-\(title)",
AnalyticsParameterItemName: title,
AnalyticsParameterContentType: "cont",
])
return true
}
I need to logEvent a dummy event explicitly, in order to receive first_open
.
May I know why is it so? Is there a way, I can still receive first_open
event automatically, without having to log a dummy event?