Build iOS Framework with dependency of other frameworks - objective-c

I am building iOS Framework that depends on another 3 frameworks. To do that in my Framework project I installed pods and the structure looks like this now:
Ok so far so good. I created podspec and added the nessecery dependecies such as AFNetworking, Socket Rocket and pjsip. When I run pod install cheryz I get in my test project this structure:
When I compile the Test project I got error:
I understand why this is happening. Because on the framework project I use workspace and the imports are made <SocketRocket/SRWebRocket> but on my Test projet where I install my framework with the dependencies I will need to write something like import "SRWebRocket.h" to work.
How I can fix this. I guess I am doing wrong the framework project. It should not be with workspace and additional frameworks such as AFNetworking in pod project ?
Also when I execute pod spec lint I get error on building. I guess this is the reason

Related

react-native: How do I install the pod dependencies used by the library in my current project?

I'm making a simple React Native library.
It has dependency on other library(react-native-device-info) that use native module.
And also i'm making a React Native project to test the library.
However, when this is executed, an error occurs saying there is no native module(react-native-device-info).
Of course i ran "pod install" in ios directory.
And if i install 'react-native-device-info' library in the project, it doesn't make the error.
So i consider to add 'react-native-device-info' library as peerDependencies, But I want developers who use my library to use it without any extra installation.
Do i need to do something on my library?
[Version]
react-native: 0.70.6
My library only has typescript files not ios and android folder.
I built the library only with tsc.
I don't think bringing RN 3rd dependencies with your library is a good idea because of possible conflicts. Imagine a situation when your lib user will previously have its own version of device-info? With peerDependencies you can control which versions are compatible with your library but with particular dependency, you have to force the user you use your version of device-info.
For example this library https://github.com/rodgomesc/vision-camera-code-scanner has a dependency to vision-camera but it doesn't bring it and only keeps it in devDependencies

How to modify Podfile in an Expo-Managed React Native project

I have implemented an app that uses react-native-branch and #config-plugins/react-native-branch with the expo-managed workflow but upon building with EAS in iOS (Expo Application Services), its throwing this error:
The Swift pod `ExpoAdapterBranch` depends upon `react-native-branch`, which does not define modules.
To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries),
you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
Is there a way to do this in expo-managed workflow?
Other details of our project:
Expo SDK: v44
react-native-branch: v5.0.0
#config-plugins/react-native-branch: v1.0.2
I finally get it to build in iOS without errors by updating my react-native-branch version from 5.0.0 to 5.4.0 without any other changes to the plugin. However, expo is now giving off a warning saying that
Some dependencies are incompatible with the installed expo package version:
- react-native-branch - expected version: 5.0.0 - actual version installed: 5.4.0
If anyone has a better solution to this, I would gladly hear it. Thanks!

Could not build Objective-C module 'ChameleonFramework'

I am trying to include the ChameleonFramework in my project but it shows this message:
Could not build Objective-C module 'ChameleonFramework'
I install the framework using cocoapods and solve like 49 errors in the code because I'm using Swift 5 and Xcode 12.2.
Also, I delete the cache for the project, uninstall the pods and install them from the console, but still not working.

Init IOS project with pods using react-native init command

Is there any way to create the IOS project with pods using react-native init command?
Currently there is different installation instruction for react native libraries.
Example: Some of them install using react-native link command while other requires to setup using cocoapods. Missing both will leads to lots of compilation errors.
Could anyone suggest what is best way to create project using react-native.
Thanks
On the official react native documentation, there are 2 ways to start up your project, which is using 'CRNA' or 'Build With Native Code'.
For CRNA, it is the fastest and easiest way to start up your project.
It really easy to run your React Native app on a physical device without setting up a development environment. If you want to run your app on the iOS Simulator or an Android Virtual Device, please refer to the instructions for building projects with native code to learn how to install Xcode and set up your Android development environment.
The react native link is used if you want to link your library through the terminal. But in some cases, there are several problem occurred related to library compatibility. I rather suggest use pods or manually link your library through XCode.
Pods is a dependency manager for native code that we use on our native code project. It will automatically generate and link the library.
If you want to have pods on your ios project. After you install cocoapods, you could follow these steps :
1. Open terminal and direct to your project (cd YOUR_PROJECT/ios
2. pod init
3. And then Podfile will be generated within the ios project.
And from now on, you should use YOUR_PROJECT.xcworkspace if you want to manage the project. Thats because Pods should be placed and included same with your project but '.xcodeproj' does not include your Pods.

Facebook sdk framework not found ios7, xcode5

I am new to Facebook SDK with iOS. I want to send invitation to friends on Facebook for using my app for this I am using Facebook (developer.facebook.com)sdk api I have registered my app installed sdk and imported framework. After importing got error as,
ld: warning: directory not found for option '-
F/Users/vijaywebsolutions/Documents/FacebookSDK'
ld: framework not found FacebookSDKkk
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Why don't you try CocoaPods for your projects its the dependency manager for Objective-C projects.
Refer CocoaPods
Simple Setup
Open Terminal and type sudo gem install cocoapods
Once installed you need to create a simple Pod file in your project directory and add the dependency to that file example.
Go to your project root directory and create Pod File by typing in terminal touch Podfile
Once created add the following line to the podfile.
platform :ios
pod 'Facebook-iOS-SDK', '~> 3.11.0'
Save the file and then in the terminal(where pod file exist) run pod install
Now it will install the requested dependencies and will create a Workspace for your project, you don't need to take any effort to configure it.
Its the best way to manage your dependencies. Give it a try you won't regret.
First you have to include facebook sdk in you project, steps as follows :
click on your project folder in xcode.
go to general tab and find Linked framework and libraries.
in that click on + sign and provide path to FacebookSDK.framework
These steps will facebook sdk in your project.
Then you have to import it in any of .m file where you want to use is it. like following line :
#import <FacebookSDK/FacebookSDK.h>
I also ran into similar error when integrating FacebookSDK into my app. I have added the framework in the Link Binary with Libraries, however, error persisted. One important thing to note when app is built, is it should be build against source Facebook iOS SDK and NOT binary SDK. I got latest source from here Facebook iOS SDK, downloaded Bolts-iOS and XCTOOL and then ran build_framework.sh Once completed, copied FacebookSDK.framework to my app and everything worked perfect.