Integrate Linphone app to my iOS app - iphone

There are about 20 questions on Linphone ios build in StackOverflow. A couple of them ask about integrating Linphone to an existing xcode project. I have followed them all. I am able to build and run the Linphone project successfully.
However, to integrate to my existing project, I have included:
linphone-sdk/apple-darwin/include and linphone-sdk/apple-darwin/lib to my project.
the following lines to Xcode project->Build Settings->Search Path/Header Search Path: submodules/linphone/coreapi submodules/linphone/mediastreamer2/include
submodules/linphone/mediastreamer2/include submodules/linphone/oRTP/include submodules/externals/gsm/ submodules/externals/osip/include submodules/externals/exosip/include submodules/externals/speex/include Classes/Utils/NinePatch/ Classes/Utils/XMLRPC/
marking all .a with target membership to my current target
What else should i do to get Linphone working in my project? Or should I make a static library of Linphone? If Yes, what things should i take care about?

To be able to build and run Linphone on a Swift project I had to the following steps:
Downlaod the latest SDK (with wget) from:
http://www.linphone.org/snapshots/ios/liblinphone-iphone-sdk-latest.zip
Copy,paste and insert in the project:
liblinphone-sdk/apple-darwin/include
liblinphone-sdk/apple-darwin/lib
liblinphone-sdk/apple-darwin/share/images
liblinphone-sdk/apple-darwin/share/sounds
Create a Bridging-Header.h with:
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <linphone/linphonecore.h>
Create a PrefixHeader.pch which import your Bridging-Header:
#import "Bridging-Header.h"
Integrate The following pods:
pod 'xmlrpc', '~> 2.3.4'
pod 'Tortuga22-NinePatch', '~> 0.1.1'
Configure the build Settings:
`
GCC_PRECOMPILE_PREFIX_HEADER = YES
GCC_PREFIX_HEADER = path/to/PrefixHeader.pch
OTHER_LDFLAGS = -ObjC $(inherited)
FRAMEWORK_SEARCH_PATHS = $(inherited)
HEADER_SEARCH_PATHS = $(inherited) ${PODS_ROOT}/Headers/Public $(PROJECT_DIR)/External/liblinphone-sdk/apple-darwin/include
LIBRARY_SEARCH_PATHS = $(inherited) $(PROJECT_DIR)/External/liblinphone-sdk/apple-darwin/lib $(PROJECT_DIR)/External/liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins
`
Configure the macros:
`
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) HAVE_OPENH264 HAVE_SILK HAVE_SSL
OTHER_SWIFT_FLAGS = $(inherited) -D HAVE_OPENH264 -D HAVE_SILK -D HAVE_SSL
`
Libraries and Framework:
First add all the libs from the folder (and subfolders) liblinphone-sdk/apple-darwin/lib.
Then be sure to add the following list:
Pods:
libPods.a
Dynamic Libs:
libz.dylib
libiconv.dylib
libxml2.dylib
libsqlite3.dylib
libc++.dylib
libstdc++.6.dylib
libresolv.dylib
Frameworks: (sorry I'm not sure if they are all 100% needed but this is how I managed to get the lib to build)
AudioToolbox.framework
UIKit.framework
QuartzCore.framework
OpenGLES.framework
MessageUI.framework
MediaPlayer.framework
CoreGraphics.framework
MobileCoreServices.framework
AddressBookUI.framework
AddressBook.framework
SystemConfiguration.framework
CFNetwork.framework
AssetsLibrary.framework
AVFoundation.framework
CoreAudio.framework
CoreMedia.framework
CoreTelephony.framework
CoreVideo.framework
Foundation.framework
CoreLocation.framework
How to test:
To verify that it was working, I integrated some sample code from the Linphone app and made some minor setups in my view controllers.
To do so I integrated in the project the following classes:
Utils.[h, m]
LinphoneManager.[h, m]
LinphoneCoreSettingsStore.[h, m]
FastAddressBook.[h, m]
LinphoneIOSVersion.h
pod 'InAppSettingsKit', '~> 2.6'
PS: I had to update them in order to build without warnings or errors.
I hope this will help someone one day!

Check with below Header Search Paths. Also set Other Linker Flags -ObjC

Related

Xcode error: Missing required module 'Firebase'

The problem:
I have a dynamic framework, which uses Firebase added by cocoapods. And I also have the App, which uses this dynamic framework. But when I try to build the project I got error Missing required module Firebase.
I tried the following:
remove derived data + clean
re-install pods
add 'Import paths' to the build settings (in this case I got error 'Library not loaded' in runtime)
My podfile:
target 'Project' do
...
end
target 'Framework' do
pod 'Firebase/Core'
pod 'Firebase/Auth'
end
The Framework is added to Embedded binaries and Linked Frameworks and Libraries.
For anyone still having this issue, doing this solved it for me.
Add this to your test target build settings.
HEADER_SEARCH_PATHS = "${SRCROOT}/Pods/Firebase/CoreOnly/Sources"
Full discussion can be found on firebase GitHub issues.
you can find HEADER_SEARCH_PATHS in Test Target > Build Settings > Search Paths > Header Search paths.
Just incase you cant find HEADER_SEARCH_PATHS in Build Settings, click the ALL button to show all settings.
Add the following to your test target:
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Firebase/CoreOnly/Sources"
That’s in test target > Build Settings > Header Search Paths.
After adding test target, running:
pod install
and add to:
HEADER_SEARCH_PATHS = $(inherited)
fixed for me.
On Framework Search Path pod put all pod projects path automatically.
Of course, to podfile added this after last pod name:
target 'TestTargetName' do
inherit! :search_paths
end
Nothing did help to me until
target 'TestTargetName' do
pod 'Firebase/Storage'
end
I'm not sure what firebase does so I can't run tests (tests do not depend on firebase at all)

mailcore2 how to implement it in swift

I tired to follow these instructions here https://github.com/MailCore/mailcore2/blob/master/build-mac/README.md but I didnt understand or dont know how to implement it in my swift app.
I know how to set up the session etc but how to install mailcore2 library onto my app is what im having problems with.
One of the things that worked for me without pods nor carthage was to download the mailcore2 library and copy the whole mailcore2 folder to the project folder. then follow this steps:
Go to Build Phases from your build target, and under 'Link Binary With Libraries',
Add libMailCore-ios.a
Add CFNetwork.framework
Add Security.framework
Set 'Other Linker Flags' under Build Settings:
-lctemplate-ios -letpan-ios -lxml2 -lsasl2 -liconv -ltidy -lz -lc++ -lresolv -stdlib=libc++ -ObjC
Make sure to use LLVM C++ standard library. Open Build Settings, scroll down to 'C++ Standard Library', and select libc++.
In Build Phases, add a Target Dependency of static mailcore2 ios.
For Swift - If you are using Mailcore in a Swift project you also need to complete the following steps:
* Create a new header file in your project and name it Project-Name-Bridging-Header.h.
* Remove any template code from the file and add #import
* In your target settings search for Objective-c Bridging Header and add a link to your bridging header. (Project-Name-Bridging-Header.h)
* You do not need to import Mailcore in any of your classes as the bridging header takes care of this automatically.

Paypal ios6 issue

While trying all the steps for integration with paypal in my application it showing the following Error,
I include all the frame works ,
AVFoundation.framework
AudioToolbox.framework
CoreMedia.framework
CoreVideo.framework
libxml2.dylib
MessageUI.framework
MobileCoreServices.framework
OpenGLES.framework
QuartzCore.framework
Security.framework
UIKit.framework
Can any one help me to sort out.Please
Finally found the answer Build Settings, added -lstdc++ -ObjC to Other Linker Flags.

What library to import for #import <libxml/HTMLparser.h>

I have imported ASIHTTP files into my project and inside ASIWebPageRequest.m there is the following import:
#import <libxml/HTMLparser.h>
which is not recognized. What library should I add in order to be recognized?
Go to the Project build settings (Project->Edit Project Settings->Build) and find the "Search Paths". In "Header Search Paths" add the following path:
$(SDKROOT)/usr/include/libxml2
Note, you may be missing all development headers after upgrading OS X (at least this was the case for me with Mavericks). To reinstall the command line tools run:
xcode-select --install
With xcode 4.5, it doesn't work. I try with
/usr/include/libxml2
and it works well
putting ${SDK_DIR}/usr/include/libxml2 for the "Header Search Paths" build setting worked for me.
*Info: I'm using xcode 5

iPhone libxml2 not found during build

I currently got some errors with libxml2 in my iPhone project. This was working before, after making some changes in my build properties building failed. (libxml2.dylib is added in the build phases)
#import <libxml/tree.h>
#import <libxml/parser.h>
#import <libxml/xmlstring.h>
#import <libxml/xpath.h>
#import <libxml/xpathInternals.h>
I've added the following items to the Build Settings:
Other Linker Flags: -lxml2
Header Search Paths: /usr/include/libxml2
I've tried adding them to the project and targets (at the same time, and switching between them) without any difference.
I also tried adding the following to the Header Search Path:
${SDKROOT}
${SDK_DIR}
Both with no result.
Building fails for:
iPhone device
iPhone and iPad emulator
Anyone have an idea?
I'm using the GData Objective-C client library: http://code.google.com/p/gdata-objectivec-client/
I'm compiling the source files directly into my project and followed all the steps that are given in the wiki. When manually importing the libxml headers again, XCode suggests the following:
#import <libxml2/libxml/tree.h>
Which doesn't work either.
Add ${SDKROOT}/usr/include/libxml2 as a header search path instead of only ${SDKROOT}.
Watch out that you all build targets that need libxml get the extra search path. If you add the path to your project's build settings, all its targets will inherit it and there shouldn't be a problem.
Add libxml2.dylib in Build Phases.
Add TFHpple.m, TFHppleElement.m, XpathQuery.m to Build Phases (Compile Sources).
Add Other Linker Flags: -lxml2 Header Search Paths: ${SDK_DIR}/usr/include/libxml2
in PROJECT --> Build Phases and in TARGETS --> Build Phases.