Integrate Linphone app to my iOS app
Asked Answered
J

2

7

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?

Judithjuditha answered 6/8, 2013 at 13:9 Comment(2)
Did you successfully integrate the SDK with your app?? if so please tell me how cause i'm stuck at it !!!Lorentz
im also getting ortp/ortp.h not found. aplease tell me any solution.Calve
H
9

To be able to build and run Linphone on a Swift project I had to the following steps:

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

  2. 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
  3. Create a Bridging-Header.h with:

    • #import <Foundation/Foundation.h>
    • #import <UIKit/UIKit.h>
    • #import <linphone/linphonecore.h>
  4. Create a PrefixHeader.pch which import your Bridging-Header:

    • #import "Bridging-Header.h"
  5. Integrate The following pods:

    • pod 'xmlrpc', '~> 2.3.4'
    • pod 'Tortuga22-NinePatch', '~> 0.1.1'
  6. 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

`

  1. 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

`

  1. 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!

Hie answered 16/7, 2015 at 15:15 Comment(2)
Hey, Kevin, thanks for the instructions! I'm close to getting it to work. But I still get many errors in LinphoneManager.h. I'm not sure what would be safe to delete. Could you share your working project? Or at least the Linphone files modified in order to work with a Swift Project?Especial
@Kevin I am trying to use it but getting the following error. can you help me out. Undefined symbols for architecture arm64: "_libmsamr_init", referenced from: -[LinphoneManager createLinphoneCore] in LinphoneManager.o "Pilfer
Q
1

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

enter image description here

Qualmish answered 30/10, 2013 at 9:33 Comment(1)
I have already mentioned this above. Anything else to be done?Judithjuditha

© 2022 - 2024 — McMap. All rights reserved.