我在XCode版本8.2.1上运行一个演示项目,并使用Swift 3.0进行开发。
通常,我不使用Cocoapods但是为了学习而决定尝试一下。
我使用了Official Firebase Get Started Tutorial for iOS
中列出的步骤我在实现上述指南概述方面非常成功。
我安装Firebase的主要目的是使用Google Analytics。作为一个启动项目。我想跟踪哪些按钮被按下然后从那里拿走。
您可以想象,我很难将按钮点击(事件)反映在我的Firebase控制台中。
来自控制台的日志:
[Firebase/Analytics][I-ACS023007] Firebase Analytics v.40100000 started
[Firebase/Analytics][I-ACS023008] To disable debug logging set the following application argument: -noFIRAnalyticsDebugEnabled (see some link)
[Firebase/Analytics][I-ACS023009] Debug logging enabled
[Firebase/Analytics][I-ACS031010] Tracking view controller. Class, ID: SomeScreen, -863544045560073292
[Firebase/Analytics][I-ACS031006] View controller already tracked. Class, ID: SomeScreen, -863544045560073292
[Firebase/Analytics][I-ACS902004] Network status has changed. Code, status: 2, Connected
[Firebase/Analytics][I-ACS003007] Successfully created Firebase Analytics App Delegate Proxy automatically. To disable the proxy, set the flag FirebaseAppDelegateProxyEnabled to NO in the Info.plist
[Firebase/Analytics][I-ACS029017] Configuration was not found in database. The configuration will be fetched from the network when necessary
[Firebase/Analytics][I-ACS023016] Firebase Analytics is ready to receive events
[Firebase/Analytics][I-ACS023080] Setting user property. Name, value: first_open_after_install (_fi), 1
[Firebase/Analytics][I-ACS023087] User property set. Name, value: first_open_after_install (_fi), 1
[Firebase/Analytics][I-ACS032003] iAd framework is not linked. Search Ad Attribution Reporter is disabled.
[Firebase/Analytics][I-ACS002002] Measurement timer scheduled to fire in approx. (s): 1562.119598150253
[Firebase/Analytics][I-ACS023028] Upload task scheduled to be executed in approx. (s): 1562.119598150253
[Firebase/Analytics][I-ACS033003] Scheduling user engagement timer
[Firebase/Analytics][I-ACS002002] Engagement timer scheduled to fire in approx. (s): 3600
[Firebase/Analytics][I-ACS023012] Firebase Analytics enabled
[Firebase/Analytics][I-ACS023051] Logging event: origin, name, params: auto, screen_view (_vs), {
firebase_screen_id (_si) = -863544045560073292;
firebase_screen_class (_sc) = SomeScreen;
firebase_event_origin (_o) = auto;
}
[Firebase/Analytics][I-ACS023073] Debug mode is enabled. Marking event as debug and real-time. Event name, parameters: screen_view (_vs), {
firebase_screen_id (_si) = -863544045560073292;
firebase_screen_class (_sc) = SomeScreen;
firebase_event_origin (_o) = auto;
firebase_realtime (_r) = 1;
firebase_debug (_dbg) = 1;
}
[Firebase/Analytics][I-ACS023072] Event logged. Event name, event params: screen_view (_vs), {
firebase_screen_id (_si) = -863544045560073292;
firebase_screen_class (_sc) = SomeScreen;
firebase_event_origin (_o) = auto;
firebase_realtime (_r) = 1;
firebase_debug (_dbg) = 1;
}
[Firebase/Analytics][I-ACS002003] Measurement timer canceled
[Firebase/Analytics][I-ACS002002] Measurement timer scheduled to fire in approx. (s): 0.6096588373184204
[Firebase/Analytics][I-ACS023028] Upload task scheduled to be executed in approx. (s): 0.6096588373184204
[Firebase/Analytics][I-ACS002001] Measurement timer fired
[Firebase/Analytics][I-ACS002003] Measurement timer canceled
[Firebase/Analytics][I-ACS023033] Starting data upload
[Firebase/Analytics][I-ACS023037] No data to upload
[Firebase/Analytics][I-ACS023126] Fetching configuration from the server
[Firebase/Analytics][I-ACS900001] Downloading data. Host: https://app-measurement.com/config/app/1:827202604534:ios:74ac2b9799955a04?platform=ios&app_instance_id=C99433DC111F4ED98E7AEF83A87DC2B9&gmp_version=40100
[Firebase/Analytics][I-ACS901006] Received SSL challenge for host. Host: https://app-measurement.com/config/app/
[Firebase/Analytics][I-ACS901007] Cancelling authentication challenge for host. Host: https://app-measurement.com/config/app/
[Firebase/Analytics][I-ACS901017] Encounter network error. Code, error: -999, Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLKey=https://app-measurement.com/config/app/1:827202604534:ios:74ac2b9799955a04?platform=ios&app_instance_id=C99433DC111F4ED98E7AEF83A87DC2B9&gmp_version=40100, NSLocalizedDescription=cancelled, NSErrorFailingURLStringKey=https://app-measurement.com/config/app/1:827202604534:ios:74ac2b9799955a04?platform=ios&app_instance_id=C99433DC111F4ED98E7AEF83A87DC2B9&gmp_version=40100}
[Firebase/Analytics][I-ACS023127] Fetched configuration. Status code: 0
[Firebase/Analytics][I-ACS023128] Unable to get the configuration from server. Network request failed. Code, Error: 0, Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLKey=https://app-measurement.com/config/app/1:827202604534:ios:74ac2b9799955a04?platform=ios&app_instance_id=C99433DC111F4ED98E7AEF83A87DC2B9&gmp_version=40100, NSLocalizedDescription=cancelled, NSErrorFailingURLStringKey=https://app-measurement.com/config/app/1:827202604534:ios:74ac2b9799955a04?platform=ios&app_instance_id=C99433DC111F4ED98E7AEF83A87DC2B9&gmp_version=40100}
[Firebase/Analytics][I-ACS023129] Network fetch failed. Will retry later. Code, error: 0, Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLKey=https://app-measurement.com/config/app/1:827202604534:ios:74ac2b9799955a04?platform=ios&app_instance_id=C99433DC111F4ED98E7AEF83A87DC2B9&gmp_version=40100, NSLocalizedDescription=cancelled, NSErrorFailingURLStringKey=https://app-measurement.com/config/app/1:827202604534:ios:74ac2b9799955a04?platform=ios&app_instance_id=C99433DC111F4ED98E7AEF83A87DC2B9&gmp_version=40100}
[Firebase/Analytics][I-ACS002002] Measurement timer scheduled to fire in approx. (s): 1813.818364858627
[Firebase/Analytics][I-ACS023028] Upload task scheduled to be executed in approx. (s): 1813.818364858627
On Loggin an Event from iOS Simulator
[Firebase/Analytics][I-ACS023051] Logging event: origin, name, params: app, select_content, {
firebase_screen_id (_si) = 3219218616125876998;
firebase_event_origin (_o) = app;
item_name = Some Screen;
firebase_screen_class (_sc) = SomeScreen;
item_id = id-Some Screen;
content_type = cont;
}
[Firebase/Analytics][I-ACS023073] Debug mode is enabled. Marking event as debug and real-time. Event name, parameters: select_content, {
firebase_event_origin (_o) = app;
firebase_realtime (_r) = 1;
item_name = Some Screen;
firebase_screen_class (_sc) = SomeScreen;
firebase_debug (_dbg) = 1;
firebase_screen_id (_si) = 3219218616125876998;
item_id = id-Some Screen;
content_type = cont;
}
[Firebase/Analytics][I-ACS023072] Event logged. Event name, event params: select_content, {
firebase_event_origin (_o) = app;
firebase_realtime (_r) = 1;
item_name = Some Screen;
firebase_screen_class (_sc) = SomeScreen;
firebase_debug (_dbg) = 1;
firebase_screen_id (_si) = 3219218616125876998;
item_id = id-Some Screen;
content_type = cont;
}
[Firebase/Analytics][I-ACS002003] Measurement timer canceled
[Firebase/Analytics][I-ACS002002] Measurement timer scheduled to fire in approx. (s): 0.9640411138534546
[Firebase/Analytics][I-ACS023028] Upload task scheduled to be executed in approx. (s): 0.9640411138534546
[Firebase/Analytics][I-ACS002001] Measurement timer fired
[Firebase/Analytics][I-ACS002003] Measurement timer canceled
[Firebase/Analytics][I-ACS023033] Starting data upload
[Firebase/Analytics][I-ACS023037] No data to upload
[Firebase/Analytics][I-ACS023126] Fetching configuration from the server
[Firebase/Analytics][I-ACS900001] Downloading data. Host: https://app-measurement.com/config/app/
[Firebase/Analytics][I-ACS901006] Received SSL challenge for host. Host: https://app-measurement.com/config/app
[Firebase/Analytics][I-ACS901007] Cancelling authentication challenge for host. Host: https://app-measurement.com/config/app
...............
and then it repeats itself..................
正如您所看到的那样:
所有这些都非常令人鼓舞,但接下来是来自Firebase的警告/错误/信息,例如:
记录事件时,模式会重复。
即使在启用调试模式后,我也从未在Firebase控制台上获得任何操作。不言而喻,我在网上看了很多关于这个问题,但无济于事。
感谢您经历这个漫长且可能乏味的问题。
任何帮助/指针都会受到赞赏!!