capacitor-community / firebase-analytics

Enable Firebase Analytics for Capacitor Apps
MIT License
160 stars 64 forks source link

No data seams to reach Firebase Analytics from the iOS targets. #118

Open Horsetopus opened 2 years ago

Horsetopus commented 2 years ago

Hi,

Describe the bug No data seams to reach Firebase Analytics from the iOS targets.

To Reproduce Steps to reproduce the behavior:

  1. following every steps in the instructions (plist is copied at the right place, bundle id is exactly the same)
  2. use logEvent
  3. add the debug flag to launch scheme in Xcode, test on iOs
  4. check the Real time or Debug View
  5. See nothing

Expected behavior Just as with Android and Web, I should see my activities

Screenshots Here are the logs of the debugger in Xcode. data seams to be sent. xcode-logs

Smartphone (please complete the following information):

Extra information For the libraries I think matter: "@capacitor-community/firebase-analytics": "^1.0.1", "@capacitor/app": "^1.0.7", "@capacitor/cli": "^3.3.4", "@capacitor/core": "^3.3.4", "@capacitor/ios": "3.3.4" I use capacitor with vuejs.

Thank you for checking on this, I've been trying for a week to make it work. Regards

Elardzhi commented 2 years ago

Same problem

mtrnik commented 2 years ago

Same problem for me

hrafnkellbaldurs commented 2 years ago

Same problem for me

qliqdev commented 2 years ago

+1 Any ideas?

UPD: Finally Found solution

In your Info.plist file add

<key>FIREBASE_ANALYTICS_COLLECTION_ENABLED</key>
<true/>
CraigRonald555 commented 2 years ago

+1 Any ideas?

UPD: Finally Found solution

In your Info.plist file add

<key>FIREBASE_ANALYTICS_COLLECTION_ENABLED</key>
<true/>

This didn't work for me

qliqdev commented 2 years ago

@CraigRonald555 So, you can try this doc

CraigRonald555 commented 2 years ago

@oneclickwebstudio

Sorry, I was being a dumb dumb, I realised after going through the docs, trying to add different packages via xCode etc. etc. that it turns out that I hadn't updated my package.json file.

basvdijk commented 2 years ago

I ran into the same issue, it turned out that my Adblocking DNS was still enabled and was blocking calls to analytics

CraigRonald555 commented 1 year ago

The debugview seems to be a bit of a nightmare, I notice a few people on the sites like stackoverflow having issues getting their device to consistently be found by the debugview page. These are the steps I used to finally enable DebugView to find my device:

  1. Close the app on the device you’re working on

  2. Go to the Firebase console and sign out of your account

  3. Sign back in again, go to the console and select the project you’re working on.

Again, not sure if this made a difference however do NOT click on DebugView item under the “Project shortcuts” list. Instead, click on the “Analytics” drop-down and select DebugView from there.

  1. It may be possible that this process updates the data stream used in the DebugView page - after following these steps I noticed events which had been missed initially were now showing up - almost as if the event was sent/received properly however the DebugView wasn’t showing the correct data stream.

Bonus tip:

Had issues with this again today, and after signing out/in to Firebase the DebugView still wasn't finding my device. What fixed it was, on my device, move the app into the background i.e. swipe up from the bottom to go to the home screen...

When you re-open the app into the foreground, the DebugView should now start displaying events. I imagine this works because the action of moving the app into the background I believe triggers any saved events on the device to be sent to Firebase, essentially flushing the queue.

uKioops commented 11 months ago

I have the same problems. App with two targets, none of them can send data to firebase analytics (DebugView and Dashboard).

I the debug console in Xcode, I have a few messages that indicates this is not working, I've tried for a week every solution that I can find but nothing works. I have no problem getting data with Android on both Flavors.

[FirebaseAnalytics][I-ACS800023] No pending snapshot to activate. SDK name: app_measurement
[FirebaseAnalytics][I-ACS029014] Successfully parsed a configuration. Version: 1697204657512920
[FirebaseAnalytics][I-ACS023016] Analytics is ready to receive events
[FirebaseAnalytics][I-ACS023012] Analytics collection enabled
[FirebaseAnalytics][I-ACS023039] Measurement data sent to network. Timestamp (ms), data: 1697802362834, <APMPBMeasurementBatch: 0x280c458a0>
[GULNetwork postURL:headers:payload:queue:usingBackgroundSession:completionHandler:]: unrecognized selector sent to instance 0x281b28c40
 [FirebaseAnalytics][I-ACS030000] Exception on worker queue. Block ID=APMMeasurement:1683. Exception: 0x0000000102dec4d8 -[APMMeasurement: -[GULNetwork postURL:headers:payload:queue:usingBackgroundSession:completionHandler:]: unrecognized selector sent to instance 0x281b28c40
[FirebaseAnalytics][I-ACS002001] Measurement timer fired
 [FirebaseAnalytics][I-ACS002003] Measurement timer canceled
[FirebaseAnalytics][I-ACS023041] Analytics is uploading but network is not uploading

I believe the last one is the reason I can't get anything outside of the app. But I have no clue where to fix this or why there is problem.

bhalbritter commented 11 months ago

I am also stuck at the 'Analytics is uploading but network is not uploading' error. Anyone else?

Update:

After some trial and error I got it to work after I updated my pods