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:
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?
Linphone 4.3 for iOS and Android | Linphone.
Linphone is an open source softphone for voice and video over IP calling and instant messaging. It is fully SIP-based, for all calling, presence and IM features.
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:
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
`
`
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) HAVE_OPENH264 HAVE_SILK HAVE_SSL
OTHER_SWIFT_FLAGS = $(inherited) -D HAVE_OPENH264 -D HAVE_SILK -D HAVE_SSL
`
First add all the libs from the folder (and subfolders) liblinphone-sdk/apple-darwin/lib
.
Then be sure to add the following list:
Pods:
Dynamic Libs:
Frameworks: (sorry I'm not sure if they are all 100% needed but this is how I managed to get the lib to build)
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:
PS: I had to update them in order to build without warnings or errors.
I hope this will help someone one day!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With