[英]Integrate Linphone app to my iOS app
There are about 20 questions on Linphone ios build in StackOverflow. 在StackOverflow中构建Linphone ios大约有20个问题。 A couple of them ask about integrating Linphone to an existing xcode project.
其中一些人询问将Linphone集成到现有的xcode项目中。 I have followed them all.
我跟着他们了。 I am able to build and run the Linphone project successfully.
我能够成功构建和运行Linphone项目。
However, to integrate to my existing project, I have included: 但是,要整合到我现有的项目中,我已经包括:
What else should i do to get Linphone working in my project? 我还应该做些什么才能让Linphone在我的项目中工作? Or should I make a static library of Linphone ?
或者我应该制作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: 为了能够在Swift项目上构建和运行Linphone,我必须执行以下步骤:
Downlaod the latest SDK (with wget) from: http://www.linphone.org/snapshots/ios/liblinphone-iphone-sdk-latest.zip 从 http://www.linphone.org/snapshots/ios/liblinphone-iphone-sdk-latest.zip下载 最新的SDK(带wget)
Copy,paste and insert in the project: 复制,粘贴和插入项目:
Create a Bridging-Header.h with: 使用以下命令创建Bridging-Header.h:
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <linphone/linphonecore.h>
Create a PrefixHeader.pch which import your Bridging-Header: 创建一个导入Bridging-Header的PrefixHeader.pch:
#import "Bridging-Header.h"
Integrate The following pods: 集成以下pod:
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
. 首先添加文件夹(和子文件夹)
liblinphone-sdk/apple-darwin/lib
。 Then be sure to add the following list: 然后一定要添加以下列表:
Pods: 荚:
Dynamic Libs: 动态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) 框架:(抱歉,我不确定它们是否都是100%需要,但这是我设法让lib构建的方式)
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. 为了验证它是否正常工作,我从Linphone应用程序中集成了一些示例代码,并在我的视图控制器中进行了一些小的设置。 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. PS:我必须更新它们才能在没有警告或错误的情况下进行构建。
I hope this will help someone one day! 我希望有一天能帮助别人!
Check with below Header Search Paths. 检查下面的标题搜索路径。 Also set Other Linker Flags
-ObjC
同时设置Other Linker Flags
-ObjC
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.