Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Preparing examples for building

Building with local SDK archive

Warning
This way is obsoleted and not recommended since iOS SDK build 2.6.97

1.  Install Install Cocoapods to build dependencies.

Code Block
languagejs
themeRDark
sudo gem install cocoapods

2. Download the source code of the examples for Mac.

Code Block
languagebash
themeRDark
git clone https://github.com/flashphoner/wcs-ios-sdk-samples.git

...

Code Block
languagebash
themeRDark
FPWCSApi2.xcframework
FPWCSApi2Swift.xcframework
WebRTC.xcframework
  • since build 2.6.97 SDK archive contains unpacked Cocoapods bundles
Code Block
themeRDark
FPWCSApi2
FPWCSApi2Swift
FPWebRTC

5. Copy the unpacked frameworks to the sample folder

  • iOS SDK builds before 2.6.97 
Code Block
languagejs
themeRDark
mkdir -p wcs-ios-sdk-samples/Frameworks
cp -R FPWCSApi2.xcframework FPWCSApi2Swift.xcframework WebRTC.xcframework wcs-ios-sdk-samples/Frameworks
Code Block
languagebash
themeRDark
mkdir -p wcs-ios-sdk-samples/sdk/fp_wcs_api2/Pods
cp -R FPWCSApi2 FPWCSApi2Swift WebRTC wcs-ios-sdk-samples/sdk/fp_wcs_api2/Pods
cd wcs-ios-sdk-samples
mv Podfile Podfile.public
mv Podfile.local Podfile

6. As a result, we have got the sample folder with the framework (iOS SDK). Now we can start building.

...

Code Block
languagebash
themeRDark
pod install

Building with SDK from Cocoapods

Tip

This way is preferrable since iOS SDK build 2.6.97

1. Install Cocoapods to build dependencies

Code Block
languagejs
themeRDark
sudo gem install cocoapods

2. Download the source code of the examples for Mac

Code Block
languagebash
themeRDark
git clone https://github.com/flashphoner/wcs-ios-sdk-samples.git

3. Run Cocoapods (this step may take a time because FPWebRTC framework is slightly fat)

Code Block
languagebash
themeRDark
pod install

Image Added

Building and launching examples using Xcode

81.  NowNow, as soon as all dependencies are ready, open workspace in Xcode.

Important! You should open the workspace, not the project file. Otherwise, the build may be broken.


92. On General page for each example set the checkbox checkbox Automatically manage signing and set iPhone developer certificate. 

...

Warning
Since build 2.6.10, steps 103-12 5 are not required!
Expand
titleTo build iOS SDK 2.5 examples...

103. At the bottom of General page delete the libraries libstdc++.6.0.9.tbd и libstdc.tbd (if they are in list). Add the library libstdc++.tbd if it is not in list.


114. On Build settings tab in Linking section add -ObjC linker flag


125. Choose File - Workspace settings menu item and set Legacy Build System value for Build System parameter



136.  For Two Way Streaming example choose target Generic iOS Device and start building from the Product - Build menu. Then connect your iPhone or iPad via USB and choose it to run the example.


147.  After After successful deployment and launch, the debug information is displayed in the lower part. This means, the Media Devices example has been correctly installed to iPhone or iPad and is running.


158.  On iPhone, you should see the interface of the application you can start testing using the WCS server

Image Modified


16. Connect to the server and send a video stream from the web camera to the iPhone.

Image Modified


So, we have built Two Way Streaming example on Mac OS Mojave using Xcode 10.1 from the source code using the iOS SDK (FPWCSApi2.framework) and executed this example on iPhone 6. The example demonstrated successful streaming of a video through Web Call Server 5.