Integrate Linphone App into iOS App

There are about 20 questions on creating Linphone ios in StackOverflow. Several of them ask about integrating Linphone into an existing xcode project. I followed them. I can successfully create and run a Linphone project.

However, to integrate into my existing project, I included:

  • linphone-sdk / apple-darwin / include and linphone-sdk / apple-darwin / lib for my project.
  • the following lines in Xcode Project-> Build Settings-> Search Path / Header Search Path : submodules / linphone / coreapi subodules / linphone / mediastreamer2 / include submodules / linphone / mediastreamer2 / include submodules / linphone / oRTP / include submodules / external / gsm / submodules / external / osip / include submodules / external / exosip / include submodules / external / speex / include Classes / Utils / NinePatch / Classes / Utils / XMLRPC /
  • marking all .a with the destination of my current destination

What else should I do to make Linphone work in my project? Or should I create a Linphone static library ? If so, what should I care about?

+6
source share
2 answers

To be able to create and run Linphone in a Swift project, I had to perform the following steps:

  • Downlaod latest SDK (with wget) from: http://www.linphone.org/snapshots/ios/liblinphone-iphone-sdk-latest.zip

  • Copy, paste and paste into the project:

    • liblinphone-sdk / apple-darwin / enable
    • liblinphone-sdk / apple-darwin / library
    • liblinphone-sdk / apple-darwin / share / images
    • liblinphone-sdk / apple-darwin / share / sounds
  • Create Bridging-Header.h with

    • #import <Foundation/Foundation.h>
    • #import <UIKit/UIKit.h>
    • #import <linphone/linphonecore.h>
  • Create a Header.pch prefix that imports your header:

    • #import "Bridging-Header.h"
  • Integrate the following types:

    • pod 'xmlrpc', '~> 2.3.4'
    • pod 'Tortuga22-NinePatch', '~> 0.1.1'
  • Configure build options:

`

 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 

`

  1. Customize macros:

`

 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) HAVE_OPENH264 HAVE_SILK HAVE_SSL OTHER_SWIFT_FLAGS = $(inherited) -D HAVE_OPENH264 -D HAVE_SILK -D HAVE_SSL 

`

  1. Libraries and Framework:

First add all the libraries from the folder (and subfolders) liblinphone-sdk/apple-darwin/lib . Then add the following list:

Beans:

  • libPods.a

Dynamic Libs:

  • libz.dylib
  • libiconv.dylib
  • libxml2.dylib
  • libsqlite3.dylib
  • Lib ++. Dylib
  • libstdc ++. 6.dylib
  • libresolv.dylib

Framework: (sorry, I'm not sure that they are all 100% needed, but I managed to get the lib assembly)

  • 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 check:

To make sure that it works, I included some sample code from the Linphone application and made some small adjustments in my controllers. To do this, I included the following classes in the project:

  • Utils. [h, m]
  • LinphoneManager. [h, m]
  • LinphoneCoreSettingsStore. [h, m]
  • FastAddressBook. [h, m]
  • LinphoneIOSVersion.h
  • pod 'InAppSettingsKit', '~> 2.6'

PS: I had to update them to create without warnings or errors.

I hope this helps someone one day!

+9
source

Check below heading search paths. Also set Other linker flags -ObjC

enter image description here

+1
source

Source: https://habr.com/ru/post/951131/


All Articles