2017-10-18 160 views
0

我試圖禁用Firebase中的手動屏幕跟蹤,將其替換爲我自己的屏幕跟蹤實施。手動屏幕跟蹤在Firebase(iOS)中不起作用

隨着屏幕自動跟蹤,每次我送火力事件有兩個額外參數:firebase_screen_classfirebase_screen_id與應用中

所以我修改了應用程序的Info.plist文件,提出了最後的ViewController的值:

FirebaseScreenReportingEnabled = NO 

我開始調用函數時,應用程序的屏幕得到改變:

Analytics.setScreenName(screenName, screenClass: screenName) 

此更改之後的結果是,Firebase的DebugView不再註冊screen_view事件,並且沒有其他信息(firebase_screen_classfirebase_screen_id)附加到後續事件。

我錯過了什麼?

編輯:這些都是在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) 
+0

您正在使用的Analytics版本是什麼?由於 – adbitx

+0

Acording我podfile.lock谷歌/分析(2.0.4): - 谷歌/核心 - Google分析(〜> 3.12) – Addev

+0

我的意思是火力地堡分析。您介意在podfile.lock中提供整個Google相關的窗格嗎?謝謝 – adbitx

回答

0

我從火力地堡的答案谷歌相關的豆莢在iOS上,他們支持自動+說明書屏幕報告或無顯示屏發送報告。 Google Analytics for Firebase不支持僅使用手動屏幕報告的情況。 FirebaseAutomaticScreenReportingEnabled已更名爲plist中標誌FirebaseScreenReportingEnabled,以減少混亂。請注意,該值必須是布爾值,而不是字符串。如果它不像您期望的那樣工作,您可以通過向Info.plist添加標誌FirebaseScreenReportingEnabled來完全禁用屏幕報告,其布爾值爲NO。

+0

這是可悲的火力地堡的不允許手動屏幕報告! –

+0

他們已經提供了手動的方式報告手冊屏幕視圖。我認爲有一個很好的理由,他們決定這樣做。 – adbitx

+0

該手冊作品只有當自動報告功能處於啓用狀態時,意味着Firebase必須添加到主應用目標中。如果您將Firebase添加到框架目標 - Firebase進入無限循環並最終崩潰 - 也稱爲堆棧溢出。解決方法是禁用自動屏幕報告並有手動記錄屏幕視圖的方法。 –