RMStore openssl/pkcs7.h file not found - ios

I am trying to use RMStore in order to verify the receipts locally. I have followed the instructions in order to add static ssl libaries: https://github.com/robotmedia/RMStore/wiki/Receipt-verification#adding-openssl
Transfered the 4 files, i downloaded binaries and headers.
1.In Build Phases, add libssl.a and libcrypto.a to Link Binary With Libraries.
2.In Build Settings, add the headers folder to the Header Search Paths.
At the second step above is where the issue exists(i think). At the moment the header search path is
$(PROJECT_DIR)/RMStore/Optional/openssl-1.0.1e/include
and the library search path:
$(PROJECT_DIR)/RMStore/Optional/openssl-1.0.1e/lib
Am i supposed to replace "RMStore" with my projects name? Where am i going wrong?
Also a side question(but relevant to openssl), when submitting to the App store, what do i answer to the "Is your product designed to use cryptography or does it contain or incorporate cryptography?" question? Do i have to apply for confirmation approval?

I separately installed openSSL via cocoapods and that solved my issue.
I used this one: https://cocoapods.org/pods/OpenSSL-Universal
but there are others available as well...

If you add folder OpenSSL to your project, and all files for OpenSSL will be there.
Add OpenSSL folder to the top of your Project (not in subfolders)
$(PROJECT_DIR)/OpenSSL/include - Header Search Paths
$(PROJECT_DIR)/OpenSSL/lib - Library Search Paths`

Just add $(PROJECT_DIR)/OpenSSL/include to Header Search Paths of Build Settings
OpenSSL Folder must be in root directory

Related

How to construct a Swift Package that links to a local (not system) library?

I must have read over a dozen posts on possible techniques to link a local library into my Swift Package. Specifically, my package depends on libturbojpeg.a, which most users won't have installed anywhere. Even if they did install it (there is a DMG), I'd have to go through hoops to make sure I was linking in the correct version. I finally found a post in the Swift Forums that basically says you can't do it now.
It appears that the only way to link it now is using .linkerSettings(LinkerSetting.unsafeFlags(..., but if you use that your package can't be managed by Xcode (see above link, and I even tried it and verified it cannot be used).
Is there some kind of workaround that allows me to distribute my Swift Package with the library?
In my Package, I created a directory "Libraries" and added my library there.
I discovered that Xcode 11 places included Swift Packages in a specific location in the Derived Folders directory. This means that it is possible to tell Xcode where to find it during the link phase.
My Package has these instructions in it for users:
1) Add the Package using Xcode->File->Packages with the URL of https://github.com/dhoerl/
2) Open the app's Project Build Phases, and from the Package shown in the left file pane, drag the Libraries/.a file into the link phase. It will appear just above the that should already be there
3) In Application Build settings, under library search paths, add:
"$(BUILD_DIR)/../../SourcePackages/checkouts//Libraries"
Build and run! VoĆ­la - works like a charm!
Note: obviously this is somewhat fragile, Xcode 12 could change how packages are managed, but its possible by then that the Swift Package Manager will support linking of local libraries (its mentioned in the above link.)

Static library integration in Swift Application: RSA SecurID SDK for iOS

I'm trying to integrate RSA SecurID in my existing iOS Application.
It doesn't seem to be a straightforward way of achieving this task.
Here is what i've tried so far:
The files included in the zip downloaded are the following:
Add the files inside inc folder to my project as well as the libSecurIDLib.a .
Check in build phases if the library is linked in binary .
Check in build settings if the library path is correct .
Clean and Build APP and keep getting these ugly and counterintuitive errors.
Anyone have any thoughts on why i'm having this problem.
It has anything to do with the headers?
Thanks!
You haven't added the other dependencies that are listed on page 38 of the Developer's Guide.
Specifically these errors are caused because you haven't added libxml2, but you also need libsqlite3 and the System configuration framework.

Deploying static library in Xcode 6

I want to deploy a static library that I've been writing in Xcode 6. I've already managed to compile the library into a .a file. Now I want to use it in another project. Also, note that including the library project is not an option, as this library is supposed to be distributed in binary.
I also managed to import the .a file into a new project, but I'm not sure what the best way to find the header files is. Should I copy them to a system folder? Should I just link to the framework's (downloaded) folder? Should I import the headers directly in the project? As the framework is meant for distribution, I think that ideally I would copy them to a system folder.
Finally, I've read that I need to build two different versions if I want the framework to be compatible with both iOS and the simulator. Is this true? Can it not be distributed in the same binary?
I distribute such a library for my company. I essentially put the .a file (built up with lipo) into a folder along with the headers. The client then needs to add the .a file to their project in the Build phases, Link Binary With Libraries. Then, they should add the path to the header files using a project relative path to the "User Header Search Paths". From my readme:
Process to Add the SDK to Your Project
1) Copy the xxx folder to the app folder, which contains the
".xcodeproj" project file, then add the directory to your project,
but don't add it to any targets (unselect the checkbox).
2) Add the appropriate library (iOS 6.0 or 7.0) folder, by going to your target's Build Phase tab, Link Binary with Libraries, tap
on "+", then navigate to the appropriate folder and select
libXXX.a
3) Add the following to the Project's Build Settings:
Search Paths -> Library Search Paths:
$PROJECT_DIR/xxx/ios // I have multiple folders each with a lib
Search Paths -> User Header Search Paths: $PROJECT_DIR/xxx
Linking -> Other Link Flags: -ObjC NOTE: If you fail to do this, your app will crash on launch (if it uses categories)
I use lipo to add both the Simulator .a files too - even thought this is not officially sanctioned. As others have said, Apple frowns on this yet offers no easy way for users of your library to use different .a files - the "official" solution would be for you to write a custom build script.

Unable to find headers in static library

I'd like to add DTCoreText to my project. I followed the instructions (starting at the DTCoreTExt GitHub page) to setup the project using CocoaPods. Finally I've created a "libPod.a" library file.
I've added the library file to my project (by copying the file in to a project sub-folder and added the file to the "Linked Frameworks and Libraries".
Finally I've tried to run the "Smoke test" as defined in the "DTCoreText Programming Guide".
Without success. XCode can't find the DTCoreText.h file (or any other file of this lib).
Have I missed something? Please help! :o)
Did you check the Header Search Paths in the Build Settings to ensure the path is correct?
Thanks to #Michael and #eharo2, you pointed into the right direction.
I wasn't aware that it's necessary to copy ALL header files together with the library file.
Btw. the relevant path is defined in the Build Settings under Search Paths in Library Search Paths

MapBox iOS SDK within your own Xcode

I downloaded MapBox example from github using the following
git clone --recursive https://github.com/mapbox/mapbox-ios-example.git
Which downloaded it including all dependencies. Now I'm trying to create a separate project and include MapBox DSK as it was in that example. I tried creating workspace then creating a single view project then add new file and select .xcodepro for the MapBox DSK but didn't work when I tried importing MapBox.h file. I never tried importing 3rd parties API before and a bit not sure how I can do that correctly. Any Idea how I can accomplish that ?
Thanks in Advance
Just try:
#import <Mapbox/Mapbox.h>
instead of just importing Mapbox.h as suggested here:
https://www.mapbox.com/blog/ios-sdk-framework
You simply drag the Mapbox-ios-sdk project file from Finder to the files pane in Xcode.
And then click the project in Xcode files pane, Target-->Build Settings. Search for "User Header Search Paths". Specify where the MapBox sdk is located.
What I do is I put the MapBox-iOS-sdk in my project directory. And I set the path as $(SRCROOT) and make sure to set it as recursive.
While you're at it also make sure -ObjC and -all_load are set in Other linker flags.
That only helps you reference the .h files, to link, also under Build Setting, Link Binary with Libraries you need libMapBox.a.
If there is a MapBox.bundle (as in the latest development branch) in the group and files pane, you want to drag that into Target->Build phases->Copy bundle resources as well. (The add button doesn't work for me.)
I think the best way is to look at mapbox-ios-example provided by MapBox and try to replicate all dependencies into your own project.
A bit late but I did it like it was explained here: http://mapbox.com/mapbox-ios-sdk/#binary.
Not messing around with git, just dragging things into your project, easy!
I think problem here is he couldn't find a specific 'file' that was titled "MapBox.Framework" inside the folder of resources downloaded from Map Box, however what you actually need to do is copy that whole folder, which is titled "MapBox.Framework" into the frameworks section. I think the confusion was that the main folder that needs to be copied doesn't look like the yellow framework icon until you copy that folder into Xcode's frameworks section.

Resources