Skip to content

Firebase Analytics on iOS Extensions is not working correctly #2896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
giorgia opened this issue Apr 25, 2019 · 28 comments
Open

Firebase Analytics on iOS Extensions is not working correctly #2896

giorgia opened this issue Apr 25, 2019 · 28 comments
Assignees
Labels
api: analytics extensions For iOS extensions targets (i.e. share, messages)

Comments

@giorgia
Copy link

giorgia commented Apr 25, 2019

DAU are wrong on iMessage extension

On iOS extensions (iMessage and Keyboard) the numbers of Firebase DAU looks wrong.
I've compared them with Fabric DAU and the discrepancy is 10x lower in Firebase vs Fabric. I know they are different product etc, but the strange part is that on the main app the numbers are almost exactly the same.
Moreover, I've been checking some of the main app events that should trigger a user_engagement event.
session_start (automatically fired by Firebase), compared to the number of users that triggered that event result to be 15x bigger than the DAU.
While on the main app DAU and users triggering the session_start is the same number.

Environment:

  • Xcode version: iOS11+
  • Firebase SDK version: 5.20.2
  • Firebase Component: Analytics
  • Component version: 5.8.1

Steps to reproduce:

Observing the live stream you can noticed the the user_engagement is almost never fired on iMessage extension.

@paulb777
Copy link
Member

Internally tracked at b/131333733

@firebase firebase deleted a comment from google-oss-bot Apr 25, 2019
@giorgia
Copy link
Author

giorgia commented Apr 30, 2019

Hi @paulb777!
Please feel free to reach me if you need any more informations. As Fabric will be gone soon, we are actively looking to find a solution for this issue.
Thank you for your help!

@paulb777
Copy link
Member

Hi @giorgia FirebaseAnalytics is not currently supported with iOS extensions. There are some details at https://firebase.google.com/docs/projects/multiprojects.

@giorgia
Copy link
Author

giorgia commented May 1, 2019

Hi @paulb777, thank you for your answer.
Is there any plan to support them in the near future? If so will that be available before Fabric sunset?
Thank you

@paulb777
Copy link
Member

paulb777 commented May 1, 2019

@giorgia It's an open question that we're working to resolve.

@JohnnyTseng
Copy link

@paulb777 Any updates of this question? Since Google Analytics is sunsetting, we're also looking for a solution to replace the GA SDK

Thanks!

@JessicaGiphy
Copy link

Hi @paulb777 we recently noticed a spike in our extension data ~mid september - wondering if a fix was made for this issue that would cause the extensions to more consistently be tracked and therefore we would see a spike. CC @giorgia

@morganchen12
Copy link
Contributor

Allen, can you answer @JessicaGiphy's question?

@allenktv
Copy link
Contributor

allenktv commented Oct 4, 2019

@JessicaGiphy we have not made any changes concerning extensions on the SDK.

@JessicaGiphy
Copy link

Thanks for the quick response

@inPhilly
Copy link

inPhilly commented Jan 4, 2020

@paulb777 is it true that app extensions for iOS are still not supported for Firebase Analytics (and hence Crashlytics)? This seems like a BIG deal, as many, many apps have app extensions that need to be monitored for analytics and crashes.

@paulb777
Copy link
Member

paulb777 commented Jan 4, 2020

@inPhilly Firebase Analytics does not support iOS extensions.

Based on https://stackoverflow.com/questions/27146019/how-to-use-crashlytics-with-ios-os-x-today-view-extensions, it looks like Crashlytics does have extension support. Presumably Crashlytics will work with the exception of its features that depend on Analytics.

Please open a separate issue for Crashlytics and extensions if you'd like to follow up in more detail.

@inPhilly
Copy link

inPhilly commented Jan 4, 2020 via email

@paulb777
Copy link
Member

paulb777 commented Jan 4, 2020

@inPhilly Understood. And sorry to hear about how challenging this is.

Please make an issue specific to Crashlytics so we can route a succinct issue to that team. This issue is about Analytics.

@morganchen12 morganchen12 added the extensions For iOS extensions targets (i.e. share, messages) label Mar 17, 2020
@slatop
Copy link

slatop commented May 6, 2020

@paulb777 can analytics handle this job or not? in iOS extensions now

@paulb777
Copy link
Member

paulb777 commented May 6, 2020

@slatop As pointed out above, Firebase Analytics does not currently support iOS extensions.

@slatop
Copy link

slatop commented May 7, 2020

@paulb777 Thank you. When can I use firebase in the extension. I have a keyboard extension project that needs analytics support after fabric fails. Very urgent. please . please. please

@paulb777
Copy link
Member

paulb777 commented May 7, 2020

@slatop Sorry, it's on the list of requested features but support isn't planned in the near future.

@sisoje
Copy link

sisoje commented Dec 4, 2020

Any news on this? Its been a year and a half since it was reported...

Every good app nowadays has at least one extension, meaning broken analytics is a real deal breaker.

@AnkitaPundir
Copy link

Any update? How to add firebase Analytics to the ios App extensions?

@wshrads
Copy link

wshrads commented Jul 29, 2021

Please provide us tentative timelines on when firebase will start support for app extensions. We have been waiting for this for a long time.

@ibayramli
Copy link

ibayramli commented Aug 8, 2021

For anyone struggling with getting the debug view output to show up in an iOS extension, it helped to add this line under FirebaseApp.configure():

FirebaseConfiguration.shared.setLoggerLevel(.debug)

Essentially, my issue was the -FIRDebugEnabled argument being ignored by the extension, and the above line manually configured Firebase into debug mode after which logger outputs started to be shown.

@lucianthorr
Copy link

I could be running into other issues but as far as I can tell, setting the LogLevel does not enable DebugView within the Firebase Console.
It'd be great to be able to programmatically enable/disable the debugView functionality. I'm running into similar issues with being unable to efficiently test metrics on iOS extensions.

@kolboch
Copy link

kolboch commented Nov 15, 2021

Did anyone manage to get it working or somehow see anything in events debug view in Firebase console? I'm trying to use Firebase Analytics from Notification Service extension but so far no success...
I'm also not sure about the current state of development of this feature, some people claim that it's not supported at all, while I get the feeling some managed to work around that as @ibayramli2001

@kolboch
Copy link

kolboch commented Nov 16, 2021

Just to give some summary of my attempts on the issue:

  • separate apps in firebase project
  • separate and targeted only for Notification Service GoogleService-Info.plist files
  • making sure that Firebase is initiated on main thread, and firing analytic event after specified delay (just making sure it's after Analytics enabled log)
    After all I couldn't manage to see the log for reporting event from analytics (my log before that is visible), nor is the event present in the debug view in Firebase console. So seems that extensions are not supported after all. I tried because in one of the issues someone claimed to have it working, maybe it's possible for keyboard extension (still just my guess what other person claim to have working), but for notification service extension no luck.
    We have one more reporting tool - Amplitude, and fortunately this one works, something to keep in mind when designing your app and choosing appropriate tools, for firebase we have to go with solution that would basically keep information about background notifications displayed in some storage and on app start we will report missing events just to be consistent.

@SwiftNativeDeveloper
Copy link

A year later. This is a huge pitfall of Firebase. I understand extensions are short-lived, but there are ways to get around it. I'm playing with the idea of an app group to transfer data from extension to target app, but the API like Analytics.logEvent don't allow me to alert the timestamp from what I can tell. So I'm having to tell my PO we either live with horribly wrong analytics data, or none at all (if we use Firebase).

@mapierce
Copy link

Yeeeeears later and I think this is still an issue. I have an app with multiple extensions that it would be great to have som analytics on via Firebase, completely unsure how to go about this as I seem to just come up against these older threads when I search for it. Any update?

@r3econ
Copy link

r3econ commented Feb 27, 2025

We would also be interested in it and waiting for an update. We'd like to add Firebase Performance Monitoring to our widgets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: analytics extensions For iOS extensions targets (i.e. share, messages)
Projects
None yet
Development

No branches or pull requests