Skip to content
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

Firebase Analytics for iOS Background Fetch. #6161

Closed
Johnnie-C opened this issue Jul 29, 2020 · 14 comments
Closed

Firebase Analytics for iOS Background Fetch. #6161

Johnnie-C opened this issue Jul 29, 2020 · 14 comments

Comments

@Johnnie-C
Copy link

  • Xcode version: 11.4 (11E146)
  • Firebase SDK version: 6.26.0
  • Firebase Component: Analytics
  • Component version: 6.4.1
  • Installation method: CocoaPods

I am trying to log event to Firebase Analytics when app is launched for background fetch.
Based on the document, session_start should be only logged when the app is in the foreground. However, I found sessions are created during the background fetch.

Is it a bug? Or please advise how should I avoid it.

@google-oss-bot

This comment has been minimized.

@Johnnie-C
Copy link
Author

Hi guys, any updates on this?

@premjubl
Copy link

Any updates on this?

@paulb777
Copy link
Member

Thanks for the reports and sorry about the lack of response here. We're tracking the issue internally at b/196036854

@allenktv
Copy link
Contributor

Hi @EzlyJohnnie, can you go into detail on how to reproduce this issue? And also accompanying logs would be very helpful. Thank you

@Johnnie-C
Copy link
Author

Just need to enable background fetch for iOS app.
When the background fetch process is kicked in by the system, session_start is logged (which I believe should not).

@allenktv
Copy link
Contributor

We are not able to reproduce this on our end. Do you have debug logs that show this behavior?

@iOS-developer-9
Copy link

iOS-developer-9 commented Nov 8, 2021

Hi, we are experiencing similar issue.

Firebase SDK version: 8.7.0 also on 8.9.1 (unfortunately did not helped: https://firebase.google.com/support/release-notes/ios)
Firebase Component: Analytics
Installation method: CocoaPods

Source what "wakes up" our app is still unknown (periodically for some increments of 30min x Y). Can't reproduce but we see in production from the logs that session_start is triggered from background for lots of users. But what we would expect that session_start is not reported in this events as per documentation.

For now we have noticed on iOS15.x.y. But is this coincidence we are not sure(on iOS14 is also happening but lot less occurrence, maybe also the user base is with iOS14 is also lot less).

Don't know if anyone else is experiencing same issue?

@romkoth
Copy link

romkoth commented Dec 23, 2021

Hi, we are experiencing similar issue.

Firebase SDK version: 8.7.0 also on 8.9.1 (unfortunately did not helped: https://firebase.google.com/support/release-notes/ios) Firebase Component: Analytics Installation method: CocoaPods

Source what "wakes up" our app is still unknown (periodically for some increments of 30min x Y). Can't reproduce but we see in production from the logs that session_start is triggered from background for lots of users. But what we would expect that session_start is not reported in this events as per documentation.

For now we have noticed on iOS15.x.y. But is this coincidence we are not sure(on iOS14 is also happening but lot less occurrence, maybe also the user base is with iOS14 is also lot less).

Don't know if anyone else is experiencing same issue?

Yes we also had such issue, after Apple released iOS 15 number of session_start was increased in few times without any reason, after moving from 8.3.1 to 8.10.0 we see less amount of events, but still in a few times bigger than it should be, does anyone found the way to fix this?

@paulb777
Copy link
Member

@iOS-developer-9 @romkoth Thanks for the reports. iOS 15 introduced pre-warming which can cause extra session_start events. We're investigating, but do not yet have a solution. We're tracking internally at b/207324460.

Some additional context at https://twitter.com/steipete/status/1466013492180312068

@tsunghung
Copy link
Contributor

This issue is caused by the life cycle inconsistency of Swift apps on iOS 15 : https://developer.apple.com/forums/thread/696539.

@tsunghung
Copy link
Contributor

tsunghung commented Dec 23, 2021

I tried another Swift app, which does not support scenes, and application(_:didFinishLaunchingWithOptions:) is not called during prewarming.
It seems that apps supporting UIScene life-cycle would have different behaviors during prewarming.

@corey-plugshare
Copy link

We are experiencing this issue as well. Is there an update or ETA on a fix? Thanks!

@tsunghung
Copy link
Contributor

We have not got any responds or solutions form Apple, so we implemented a workaround in Firebase/Analytics v8.12.0, which will be released in about 2 weeks.

@firebase firebase locked and limited conversation to collaborators Mar 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests