How to add "linked framework" (like CoreImage or CoreBluetooth) from plugin




I want to create a plugin that wraps a shared framework. However it requires some core frameworks to function (like CoreBluetooth.framework and CoreImage.framework) and I am not sure how I can include those in the {N}-app without editing the xcode project manually after installing the plugin.

How to reference other core “linked frameworks” from a plugin?

Thank you


I think you don’t have to link manually the built-in frameworks. Do you get any errors when you access those APIs?


I am trying to create a plugin to wrap a static framework (MyFramework.framework). This framework requires some core frameworks like CoreBluetooth.framework, CoreImage.framework and ExternalAccessory.framework. If these are not added to xcode, the compiler emits error messages of flags that cannot be found etc. I need these frameworks to be added to the xcode project when I install the plugin but I can not find any example of how to do this. I thought it could be solved in the xcconfig-files but I have not found any solution.

Best regards.


I have now experimented with creating my own nativescript plugin, and it works. The frameworks are added to the app when the plugin is installed. I have solved the CoreBluetooth.framework issue by adding “linker flags” in the plugin .xcconfig. It is not visible in xcode, but it seems to compile just fine.

One thing I notice is that my plugin uses three frameworks, and all of them are added as “linked frameworks and libraries” but only one are placed in “embedded binaries”. I do not really understand the difference, do they need to be embedded or is it sufficient to link?