I followed below link to use openssl to generate pkcs12 file in a ios swift project.
https://stackoverflow.com/a/41856095/5059959
Now I want to create a private pod which requires openssl. How to can I do that?
I don't know how to do steps specified at above link
Could someone help me?
Related
I am new to XCode and Swift. Trying to create a simple project that uses MQTT protocol. For that, there is a Swift library CocoaMQTT and there are directions on how to integrate it in an XCode project:
Installation
To integrate CocoaMQTT into your Xcode project using CocoaPods,
you need to modify you Podfile like the followings:
use_frameworks!
target 'Example' do
pod 'CocoaMQTT' end
Then, run the following command:
$ pod install
At last, import "CocoaMQTT" to your project:
import CocoaMQTT
The directives above are not straight forward to me as for a newbie, and I followed another way by importing the CocoaMQTT package through the XCode main menu: File -> Add Packages. Once the package was downloaded, I saw that the package (and the other dependencies) were automatically added to my project in the file navigator:
Question: do I still need to do CocoaPad installation as described above, or importing the package as I did is the new and sufficient way to integrate the library into the project? The Podfile that is mentioned in the instructions cannot be modified in XCode.
[Swift package] is the new and sufficient way
Correct. The library is now installed in your project and there is no further work to do.
In general, Swift packages supersede Cocoapods. Wherever possible, if a library offers a Swift package installation, you'll probably want to use that rather than Cocoapods.
In this particular case, you should file an issue on the documentation. They have added Swift Package as an alternative way of installing this library but they have forgotten to add that information to the instructions in the Readme.
Getting pjsip user agent sample project working
I have compiled the libraries for pjsip here:
pjsip ios
I have gotten android to work and I am trying to get the xcode project running for the user agent. I have compiled it against openssl. I added the user agent library and the openssl libraries to the library folder. Once done, I have one error left that I cannot seem to solve:
Showing All Errors Only
Library not found for -lssl
I am getting this even when I do not use or build against the openssl options
my openssl libs are: libcrypto.a and libssl.a once those are added, my error count goes from 111 to one. This is my first ios project so I was wondering if I missed a step adding the references.
has nothing to do with whether ssl is enabled. Some of the libraries use openssl so the project needed header and library paths. Copied the OpenSSL output I already had to the project, and it built fine
Found the answer here: Wai Ha Lee answered it.
add open ssl
I am writing a new library for React Native that uses native components for iOS and Android. It depends on another native library via Cocoapods, and contains a .podspec file. When I try to link it to a test project using react-native link, it successfully adds the source project as a library, but doesn't install the dependency via Cocoapods.
It looks like there are ways to customize the link behavior via rnpm keys in the package.json file, but I can't find any info on what those should be (it's also unclear if those are used by the newer link command, or are a holdover from the actual rnpm days.) If there are docs on that that you know of, please pass them along!
Otherwise, my main question is this: how can I get react-native link to install my dependency via Cocoapods, or do I need to reinvent that wheel?
Thanks in advance!
I have installed OpenSSL in xcode for receipt validation, but it doesn't work.
I download openssl.xcodeproj and openssl-1.0.1f. I extract openssl-1.0.1f and add openssl.xcodeproj to my project.
I edit the Header Search Path to :
/Users/marko/Documents/Razvoj/BIView\ Mobile\ New\ Version/openssl/include/openssl
I added libcrypto.a in Target Dependencies under Build Phases
and added libcrypto.a in Link Binary With Libraries
as was described in http://atastypixel.com/blog/easy-inclusion-of-openssl-into-iphone-app-projects/.
But when I build project it stops with error :
clang: error: no such file or directory: '/Users/ .... -bmgslnakszsfovecplbzoslykrxo/Build/Products/Debug-iphoneos/libcrypto.a'
Why ?
OK, how to build and install it....
It might be easier to use a pre-built version of OpenSSL for iOS. You can find one at this Github account. The OpenSSL from that Github are multi-arch. They have ARMv7, ARMv7s, ARM64, and i386. That means they work with devices and simulators.
Download either OpenSSL 1.0.1e or 1.0.1f. Install it in a location like /usr/local/ssl/ios.
Then, add the headers to your Xcode project. They are located in /usr/local/ssl/ios/include:
Finally, add the multi-arch libs (libcrypto.a and libssl.a) to your Xcode project. They are located in /usr/local/ssl/ios/lib:
You need to add the library as a Framework. See this question: how to add an existing framework in Xcode 5.
Its OK to add the OpenSSL libraries under Frameworks. Its how things are done under Apple/Xcode.
I use the Absolute Path like in the image below because Crypto++, OpenSSL, etc are installed in /usr/local. The image below is a screen capture I have handy of Crypto++, and not OpenSSL's libcrypto.a or libssl.a. But the same applies to all libraries.
Is there an OpenSSL cocoapod that works with bitcode enabled? Previously I was using the pod 'OpenSSL', but I want to have bitcode in my app. Is there any way to do this, or must I build OpenSSL by myself?
Thanks
I can answer this question, as I figured out how to do it. Since there is no official CocoaPod, you will have to use a build script to build it yourself. Here is the build script that I used:
https://gist.github.com/felix-schwarz/c61c0f7d9ab60f53ebb0
This build script will generate two folders for you, one called lib and another called include. Go to your project settings and go to Build Phases. Open the section called Link Binary With Libraries. Then, open the lib folder and drag libcrypto_iOS.a and libssl_iOS.a into the Link Binary With Libraries section.
Next, go to Build Settings. Under the Search Paths section, Go to Header Search Paths, double click the field, which will open another box. In there, drag the include folder. Also make sure that the Library Search Paths have the lib folder.
Hope this helps!
There is an openssl-ios-bitcode pod now, currently with OpenSSL 1.0.212.
I didn't encounter any pod for openSSL with bitcode, but if you build it yourself, it is possible.
As you mentioned yourself, you can use OpenSSL-for-iOS (https://github.com/x2on/OpenSSL-for-iPhone)
and just run ./build-libssl.sh
Then you will see some libraries with the openSSL output.
See how it has been linked and used in the OpenSSL-for-iOS example project, and try to do the same in your project.