Manual screen tracking not working in Firebase (iOS)

烂漫一生 提交于 2020-01-04 15:28:46

问题


I'm trying to disable the manual screen tracking in Firebase, replacing it with my own implementation of screen tracking.

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

So I modified the app's Info.plist file with :

FirebaseScreenReportingEnabled = NO

And I started calling the function when the screen of the app gets changed:

Analytics.setScreenName(screenName, screenClass: screenName)

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.

What do am I missing?

Edit: 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)

回答1:


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.



来源:https://stackoverflow.com/questions/46815428/manual-screen-tracking-not-working-in-firebase-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!