-
Notifications
You must be signed in to change notification settings - Fork 263
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
Linking against a dylib which is not safe for use in application extensions #396
Comments
Our SDK doesn't use any extension-unavailable code in the extension service, so your app wouldn't get rejected. But the warning is certainly annoying. You can also use Cocoapods, or link directly against our static binary, which would also get rid of the error, but neither of these things are necessary. Eventually in the future I will look into either splitting out the extension-specific functionality into its own separate library, or I'll look into other approaches. |
+1 |
We're now working on a PR to fix this issue. Unfortunately it will need to be a breaking change so it will need to wait until our next major release (3.0) Essentially we are splitting out extension-specific functionality into a separate (smaller) framework Here is the current state of the PR: #427 |
@Nightsd01 is there an existing branch with this fix? And what do you mean by |
@otymartin The static OneSignal framework can be found here: The PR #427 noted above just splits out the Notification Extension Service specific part of the SDK into its own target to make it smaller and to fix any warnings about APIs being referenced that are not available in that target. I don't believe it would fix the dynamic linking warnings. |
Ahh I see - so the warnings are here to stay until 3.0.0? |
Correct, it requires |
@JKalash So what do I set it to |
@otymartin It would be on the "OneSignal" framework project itself, like the following. |
@JKalash Ok, although I hate seeing warnings I can live with. it knowing it won't affect the actual push delivery and App Store review process. Thanks |
@jkasten2 is this problem fixed? |
@otymartin Unfortunately this issue is not simple to fix since it requires having a separate SDK for the App target and the notification service extension target with no shared symbols. We are still looking into a fix for this. |
Still a problem here in June 2021. |
same problem |
I'm using OneSignal via SPM and have the same problem. Any solutions? |
The solution for this requires modularizing the SDK and is being actively developed. I apologize for the inconvenience and thank you for your patience. |
same |
Same. I try to have no warnings in projects but I'll have to continue waiting. |
Well, changing SDK solved my problem 😃 |
Seeing the same on SDK version 3.10.1 with Cocoapods. |
Can anyone confirm that this is just a warning and will not be rejected by Apple if the extension is linked with the |
It is the first answer here...#396 (comment) |
Hello! In order to fix this issue the SDK needed to be modularized to exclude references to There is now a beta release available that fixes this issue by providing a Cocoapods subspec or SwiftPM product Note that there are a couple extra steps for Cocoapods to remove the warning, and all steps can be found in the release notes. Also note that using |
I attempted to add the beta release to my project. I got it working for initial launch of my app but on subsequent launches of my app the OneSignal initialization code crashes. |
@hieuctrac On the device you installed the app on, was it running an older version of the OneSignal SDK? If so what version? If you install your app on another device (or fully uninstall it and reinstall it on the same device) do you see the same issue? |
I still get the warning, even though I've updated to 3.11.1 from 3.10.0, cleaned the build folders and recompiled everything. Is there something else I need to do? My project uses Objective-C, Cocoapods and has a deployment target of iOS 12. |
@lhasiuk Can you double check that you have made these changes to your project from the 3.11.0 release notes?
|
@jkasten2 Thanks, I had not done those things. However, once I did all of them and double checked that I had, I started to have issues where the One Signal Extension is trying to include other Pods that are only used by my main application and since some of those pods reference things like [UIApplication sharedApplication], which is not available in an extension, I get errors during compilation. I tried making sure they were not mentioned in Other Linker Flags and even tried removing everything except -ObjC from Other Linker Flags, but it didn't help. Any suggestions how to solve that? |
I had the same issue. Did you find any solution? |
I'm using OneSignal with SPM and I'm getting the same warning. Are there any updates? |
@sereisoglu This warning should be resolved if you update to the 3.11.0 SDK and follow the SwiftPM instructions in the release notes:
If the above is correct in your project can you share more details about your project?
|
@jkasten2 Thanks, this worked. I saw that there are 2 OneSignal libraries: |
@sereisoglu The key thing is that you use
|
@jkasten2 When I add |
@sereisoglu This is the same no matter if you use |
If I use Cocoapods and see same issue as @lhasiuk and @Sergozh with complains about [UIApplication sharedApplication]. Any solution? Also, I see that the instructions on the Onesignal tutorial page is not updated either. I tried to move the Extension outside of the main target, but that gives a different error. Any clues on how to do it? |
I still get this warning with latest OneSignal framework. Latest Xcode, etc. |
See this article for a workaround on how to get rid of this annoying warning. I did only use the OneSignalExtension package for my NotificationService extension and OneSignal package for my main app but that did not solve it. |
So, is this still not fixed? Earlier in this thread it was going to be fixed for 3.x, but I'm getting it with 3.12.5, incorporated via SPM. It’s been nearly five years. |
Unbelievable how this is still not fixed as today. Any update on this @emawby? Maybe at least re-open the issue...? Here is a way to at least silence the warning:
|
Hi @JetForMe and @rursache, did you use
If you have made these changes and still seeing errors, can you share what your updated error is? |
Description:
Hi,
it is a bit odd that configuring OneSignal requires an app extension and OneSignal.framework is not app extension safe...
Environment
Xcode 9.4.1, integrating using Carthage 0.30.1 using Carthage integration guide
Steps to Reproduce Issue:
Anything else:
The text was updated successfully, but these errors were encountered: