手动屏幕跟踪在Firebase(iOS)中不起作用 [英] Manual screen tracking not working in Firebase (iOS)
问题描述
我正在尝试在Firebase中禁用手动屏幕跟踪,将其替换为我自己的屏幕跟踪实现.
I'm trying to disable the manual screen tracking in Firebase, replacing it with my own implementation of screen tracking.
通过自动屏幕跟踪,我发送到firebase的每个事件都有两个额外的参数:firebase_screen_class
和firebase_screen_id
,其中包含应用程序中显示的最后一个ViewController的值
With the automatic screen tracking, every event I send to firebase has two extra params: firebase_screen_class
and firebase_screen_id
with the value of the last ViewController presented in the app
所以我用:
FirebaseScreenReportingEnabled = NO
当应用程序的屏幕更改时,我开始调用该函数:
And I started calling the function when the screen of the app gets changed:
Analytics.setScreenName(screenName, screenClass: screenName)
此更改后的结果是Firebase的DebugView不再注册screen_view
事件,并且以后的事件没有附加任何信息(firebase_screen_class
和firebase_screen_id
).
The result after this change is that the DebugView of Firebase no longer registers screen_view
events and no extra info (firebase_screen_class
and firebase_screen_id
) is attached to later events.
我想念什么?
编辑:这些是podfile.lock中与Google相关的pod.
Those are the Google related pods in the podfile.lock
- Firebase/AdMob (4.2.0):
- Firebase/Core
- Google-Mobile-Ads-SDK (= 7.24.0)
- Firebase/Core (4.2.0):
- FirebaseAnalytics (= 4.0.3)
- FirebaseCore (= 4.0.7)
- Firebase/RemoteConfig (4.2.0):
- Firebase/Core
- FirebaseRemoteConfig (= 2.0.3)
- FirebaseAnalytics (4.0.3):
- FirebaseCore (~> 4.0)
- FirebaseInstanceID (~> 2.0)
- GoogleToolboxForMac/NSData+zlib (~> 2.1)
- nanopb (~> 0.3)
- FirebaseCore (4.0.7):
- GoogleToolboxForMac/NSData+zlib (~> 2.1)
- nanopb (~> 0.3)
- FirebaseInstanceID (2.0.3)
- FirebaseRemoteConfig (2.0.3):
- FirebaseAnalytics (~> 4.0)
- FirebaseInstanceID (~> 2.0)
- GoogleToolboxForMac/NSData+zlib (~> 2.1)
- Protobuf (~> 3.1)
- Google-Mobile-Ads-SDK (7.24.0)
- GoogleAnalytics (3.17.0)
- GoogleSignIn (4.1.0):
- GoogleToolboxForMac/NSDictionary+URLArguments (~> 2.1)
- GoogleToolboxForMac/NSString+URLArguments (~> 2.1)
- GTMOAuth2 (~> 1.0)
- GTMSessionFetcher/Core (~> 1.1)
- GoogleToolboxForMac/DebugUtils (2.1.1):
- GoogleToolboxForMac/Defines (= 2.1.1)
- GoogleToolboxForMac/Defines (2.1.1)
- GoogleToolboxForMac/NSData+zlib (2.1.1):
- GoogleToolboxForMac/Defines (= 2.1.1)
- GoogleToolboxForMac/NSDictionary+URLArguments (2.1.1):
- GoogleToolboxForMac/DebugUtils (= 2.1.1)
- GoogleToolboxForMac/Defines (= 2.1.1)
- GoogleToolboxForMac/NSString+URLArguments (= 2.1.1)
- GoogleToolboxForMac/NSString+URLArguments (2.1.1)
- GTMOAuth2 (1.1.5):
- GTMSessionFetcher (~> 1.1)
- GTMSessionFetcher (1.1.12):
- GTMSessionFetcher/Full (= 1.1.12)
- GTMSessionFetcher/Core (1.1.12)
- GTMSessionFetcher/Full (1.1.12):
- GTMSessionFetcher/Core (= 1.1.12)
推荐答案
我从Firebase得到的答案是,在iOS上,它们支持自动+手动屏幕报告或完全不支持屏幕报告. Google Analytics for Firebase不支持仅手动进行屏幕报告的情况. plist标志 FirebaseAutomaticScreenReportingEnabled 已重命名为 FirebaseScreenReportingEnabled ,以减少混乱.请注意,该值必须是布尔值,而不是字符串.如果它没有按预期工作,则可以通过将标志 FirebaseScreenReportingEnabled 添加到Info.plist并将布尔值设置为NO来完全禁用屏幕报告.
I got the answer from Firebase that On iOS, they support automatic + manual screen reporting or no screen reporting at all. Google Analytics for Firebase does NOT support the case of manual-only screen reporting. The plist flag FirebaseAutomaticScreenReportingEnabled has been renamed to FirebaseScreenReportingEnabled to reduce that confusion. Note that the value must be a Boolean and not a String. If it doesn't work as you expected, you can disable screen reporting completely by adding to Info.plist the flag FirebaseScreenReportingEnabled with Boolean value of NO.
这篇关于手动屏幕跟踪在Firebase(iOS)中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!