Firebase Analytics events from iOS not showing up

后端 未结 10 1875
半阙折子戏
半阙折子戏 2020-12-15 03:39

I am testing the new Google-powered Firebase, and have implemented remote notifications and crash reporting. I am, however, having massive problems with getting Analytics to

相关标签:
10条回答
  • 2020-12-15 04:03

    first_open, session_start are listed by Firebase as Automatically collected events.

    I can not help you with the extreme upload task delay you encounter on your custom events.. but Firebase Analytics is less than a week old and it may be just a bug on their side.

    I found this StackOverflow question which mention the same debug lines but related to Google App Measurement or old Google Mobile Analytics SDK.

    Also, be aware that Firebase Console won't show events in real-time (source):

    You can view aggregrated statistics about your events in the Firebase console dashboards. These dashboards update periodically throughout the day. For immediate testing, use the logcat output as described in the previous section.

    0 讨论(0)
  • 2020-12-15 04:03

    The most common problem most of the people are facing is the firebase is not logging events even though everything is working perfectly fine This is what i found in there docs

    If you need to deactivate Analytics collection permanently in a version of your app, set FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED to YES in your app's Info.plist file. Setting FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED to YES takes priority over any values for FIREBASE_ANALYTICS_COLLECTION_ENABLED in your app's Info.plist as well as any values set with setAnalyticsCollectionEnabled.

    To re-enable collection, remove FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED from your Info.plist. Setting FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED to NO has no effect and results in the same behavior as not having FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED set in your Info.plist file.

    So you have to remove FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED from your google-servicesinfo.plist file to make analytics work

    0 讨论(0)
  • 2020-12-15 04:04

    Make sure your device is not set to battery save mode. In this mode events may be accumulated and sent only once in a while, even if you run firebase in debug mode as explained by others.

    0 讨论(0)
  • 2020-12-15 04:04

    It takes too much time to update events in Firebase. Probably it is done once a day. See iOS or Android logging of Firebase events.

    You can enable verbose logging to monitor logging of events by the SDK to help verify that events are being logged properly. This includes both automatically and manually logged events.

    You can enable verbose logging as follows:

    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.

    The next time you run your app, your events will display in the Xcode debug console, helping you immediately verify that events are being sent.

    0 讨论(0)
  • 2020-12-15 04:08

    In Swift it should be like:

    FIRAnalytics.logEvent(withName: "SignUp", parameters: ["user_id": userid, "user_name": username])
    

    To view this event in Firebase:

    1. Go to Firebase console → Analytics tab
    2. Click on DebugView tab; your Events are shown there

    To view this event in Xcode:

    1. In Xcode, select Product → Scheme → EditScheme
    2. Select Run from left Menu
    3. Select Arguments tab
    4. In the Arguments Passed on Launch, add -FIRAnalyticsDebugEnabled

    One dash only!!

    Note that -FIRAnalyticsDebugEnabled has only ONE dash in front of it.

    0 讨论(0)
  • 2020-12-15 04:14

    Firebase events are batched together and uploaded once every hour in order to prevent excessive battery drain on the devices. On iOS when you background the app before the 1h upload target the events will be dispatched at this time in the background.

    You can enable debug logging for iOS (https://firebase.google.com/docs/analytics/ios/events#view_events_in_the_xcode_debug_console) to see when events are uploaded in debug console.

    Once the events are uploaded there is delay at about 3h before the data will show up in the Firebase Analytics dashboard. Also the default day range excludes "today" so you only see events from yesterday. You can switch the date picker to include Today if you like to see the latest events.

    The main reason to delay/batch data uploading is to save battery. Each time the network is used the device mobile network modem is put in hi power mode and stay in this mode for a while. If network is used regularly it has sever impact on the battery life. By batching the uploads together and delaying the upload the impact on the battery is significantly reduced.

    0 讨论(0)
提交回复
热议问题