Since UIApplication.shared is not available in app extensions, anno…#3355
Conversation
It's indeed a bit harder than I'd like, if you need help or want us to test out changes before release just let us know and we'll do it. |
badboy
left a comment
There was a problem hiding this comment.
Code looks fine, but I don't understand the commit message.
Does this work for app extensions, because UIApplication.share only fails at runtime in app extensions, so as long as something else is passed in for BackgroundTaskScheduler it is never instantiated?
Why do that for GleanUploadTaskProvider too, our own type?
(Basically I don't fully understand how this would be used in the app extension part, maybe you can link me how that will be used in ffx iOS?)
b1a1d37 to
9bb7af0
Compare
…ons, as app extensions run in a restricted environment without access to `UIApplication.shared`.
9bb7af0 to
a0ac8ac
Compare

Followup to #3347.
Unfortunately, we realized after trying to pull in the latest 66.2.0 Glean SDK release that
UIApplication.sharedcan't be exposed in the init API for app extensions. I haven't worked a lot with Swift packages so I apologize not catching this sooner!The fix is to hide it, or annotate the
PingUploadSchedulerclass as unavailable for iOS app extensions. I opted to hide it so we didn't need to add any restrictions to the package. That said, Firefox for iOS never uses the Glean SDK directly from our app extensions (which are separate processes from the Firefox for iOS client). Instead, we use other ways to pass telemetry back to our main Client.I was able to set up the Glean SDK framework for local testing with my Firefox for iOS client and this change appears to fix the problem. I will be able to better test future work better this way! 🙏