-
Notifications
You must be signed in to change notification settings - Fork 32
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
Unable to compile in app extension targets #226
Comments
@chrisvasselli Thank you for reporting this and sorry for getting back to you so late! I just tried to reproduce this to fix it, but despite creating 3 different kinds of app extensions in a sample project (Action, App Intents, Widget) and adding TelemetryDeck to each of them, I did not run into this build error. Can you tell me what kind of app extension I need to create to reproduce? Also, even without being able to reproduce, I have tried to fix this by providing a fallback implementation when |
Huh, I'm surprised you're not seeing the issue. What happens if it actually hits code that uses UIApplication.shared at runtime. I'm seeing it when I have a share extension in my project. I'm using CocoaPods to integrate, so maybe that integrates in a different way. I looked at the RevenueCat SDK which I also have integrated, and it looks like it's a pretty awkward limitation to get around. Sounds like there aren't any compile-time checks you can do: |
@chrisvasselli Thank you for the additional details! First of all, I want to mention that we do not officially support CocoaPods (anymore). We only still kinda support it because our Flutter SDK wraps the Swift SDK and required it for a long time. But now that CocoaPods itself is officially deprecated and no longer maintained, even the Flutter community is fully switching to SwiftPM, so it's probably only a matter of time before we drop CocoaPods support entirely. So it's probably worth considering switching to SwiftPM if you can. Please do let us know if there's a reason why you can't switch so we can understand your needs and revise our plans if needed. Having that said, I will try my best to help resolve this issue. Thank you for sharing how RevenueCat deals with the situation. Unlike the RevenueCat SDK, our SDK does not rely on As there's no built-in flag we could check during compile-time, I have added a section to our README documenting how to easily setup one for your app extension targets. Please try that solution with the |
I'd like to be able to use TelemetryDeck from my app extensions. However, the build currently fails because of references to
UIApplication.shared
which is not available in app extensions. There appear to be four references inSignalManager.swift
.The text was updated successfully, but these errors were encountered: