如何在Unity中使用AnalyticsEventScreenView调用LogEvent?

问题描述

https://firebase.googleblog.com/2020/08/google-analytics-manual-screen-view.html上的博客文章提到了调用SetCurrentScreen的问题。

Unity中的Firebase Analytics也是如此吗?我似乎无法使用AnalyticsEventScreenView参数调用LogEvent。

谢谢。

解决方法

看来,截至9月24日,Unity SDK尚未完全更新为使用最新的iOS SDK。

但是,如果您手动更新Podfile以使用版本6.29.0which is when it was introduced),如下所示:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios,'11.0'

target 'UnityFramework' do
  pod 'Firebase/Analytics','6.29.0'
  pod 'Firebase/Core','6.29.0'
end

然后您可以像这样手动使用它:

Firebase.Analytics.FirebaseAnalytics.LogEvent("screen_view",new Firebase.Analytics.Parameter("screen_name",name));