问题描述
在StackOverflow中构建Linphone ios大约有20个问题。其中一些人询问将Linphone集成到现有的xcode项目中。我跟着他们了。我能够成功构建和运行Linphone项目。
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 和 linphone -sdk / apple-darwin / lib 到我的项目。
- 以下行到 Xcode项目 - >构建设置 - >搜索路径/页眉搜索路径:子模块/ linphone / coreapi子模块/ linphone / mediastreamer2 / include
子模块/ Linphone中/ mediastreamer2 /包括子模块/ Linphone中/ oRTP /包括子模块/外部组件/ GSM /子模块/外部组件/约瑟夫/包括子模块/外部组件/ exosip /包括子模块/外部组件/ Speex语音/包括类/ utils的/ NinePatch /班/ Utils / XMLRPC / - 标记所有.a,目标成员资格为当前目标
- 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/includesubmodules/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
我还应该做些什么才能让Linphone在我的项目中工作?或者我应该制作一个Linphone的静态库?如果是,我应该注意什么?
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?
推荐答案
为了能够在Swift项目上构建和运行Linphone,我必须执行以下步骤:
To be able to build and run Linphone on a Swift project I had to the following steps:
-
从以下位置下载最新的SDK(带wget):
复制,粘贴并插入项目中
- liblinphone-sdk / apple-darwin / include
- liblinphone-sdk / apple-darwin / lib
- liblinphone- sdk / apple-darwin / share / images
- liblinphone-sdk / apple-darwin / share / sounds
- liblinphone-sdk/apple-darwin/include
- liblinphone-sdk/apple-darwin/lib
- liblinphone-sdk/apple-darwin/share/images
- liblinphone-sdk/apple-darwin/share/sounds
使用以下内容创建Bridging-Header.h:
-
#import< Foundation / Foundation.h>
-
#import< UIKit / UIKit.h>
-
#import< linphone / linphonecore.h>
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <linphone/linphonecore.h>
创建一个导入Bridging-Header的PrefixHeader.pch:
-
#importBridging-Header.h
#import "Bridging-Header.h"
整合以下豆荚:
-
pod'xmlrpc','〜> 2.3.4'
-
pod'Tortuga22-NinePatch','〜> 0.1.1'
pod 'xmlrpc', '~> 2.3.4'
pod 'Tortuga22-NinePatch', '~> 0.1.1'
配置构建设置:
`
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:
'p>`
`
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:
首先添加文件夹(和子文件夹)中的所有库 liblinphone-sdk / apple-darwin / lib
。
然后一定要添加以下列表:
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
动态图书馆:
- libz.dylib
- libiconv.dylib
- libxml2.dylib
- libsqlite3.dylib
- libc ++。dylib
- libstdc ++。6.dylib
- libresolv.dylib
- libz.dylib
- libiconv.dylib
- libxml2.dylib
- libsqlite3.dylib
- libc++.dylib
- libstdc++.6.dylib
- libresolv.dylib
框架:(对不起,我不确定它们是否都是100 %需要,但这是我设法让lib建立的方式)
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
- 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
如何测试:
为了验证它是否正常工作,我从Linphone应用程序中集成了一些示例代码,并在我的视图控制器中进行了一些小的设置。
为此,我在项目中集成了以下类:
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'
- Utils.[h, m]
- LinphoneManager.[h, m]
- LinphoneCoreSettingsStore.[h, m]
- FastAddressBook.[h, m]
- LinphoneIOSVersion.h
- pod 'InAppSettingsKit', '~> 2.6'
PS:我必须更新它们才能在没有警告或错误的情况下进行构建。
PS: I had to update them in order to build without warnings or errors.
我希望有一天能帮到某人!
I hope this will help someone one day!
这篇关于将Linphone应用程序集成到我的iOS应用程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!