Turning Firebase Analytics on on Xcode

萝らか妹 提交于 2020-06-24 02:56:07

问题


I am trying to test the implementation of my Firebase Analytics. In their documentation they state that:

Enable debug mode by passing the -FIRDebugEnabled argument to the application. You can add this argument in the application’s Xcode scheme. When debug mode is enabled via -FIRDebugEnabled, further executions of the application will also be in debug mode. In order to return to default mode, you must explicitly disable the debug mode with the application argument -FIRDebugDisabled.

Unfortunately I do not understand where it is that I set this scheme. In Android this was easy. Help would be appreciated.


回答1:


I have found the answer on this alternative page of Google:

https://firebase.google.com/docs/analytics/ios/start

  1. In Xcode, select Product > Scheme > Edit scheme...
  2. Select Run from the left menu.
  3. Select the Arguments tab.
  4. In the Arguments Passed On Launch section, add -FIRAnalyticsDebugEnabled.

I wish Google would stop releasing half baked products and documentation. Could save hundreds of thousands of hours worldwide




回答2:


I tried editing scheme and adding parameters, https://firebase.google.com/docs/analytics/ios/start but it did not work for me. In addition, I added following code after configuring FirebaseApp, at AppDelegate, didFinishLaunchingWithOptions

    FirebaseApp.configure()
    Analytics.setAnalyticsCollectionEnabled(true)

and it worked for me. I hope it helps you too.




回答3:


I think you should check console log on XCode. Because I will show log

To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see https://help.apple.com/xcode/mac/8.0/#/dev3ec8a1cb4)

Check again, if you don't:

  • Add key FirebaseCrashlyticsCollectionEnabled has value true in Info.plist
  • set key IS_ANALYTICS_ENABLED is true in GoogleService-Info.plist
  • Make sure file GoogleService-Info.plist add will all targets and save in root project


来源:https://stackoverflow.com/questions/43109486/turning-firebase-analytics-on-on-xcode

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