2

I have checked details from Jitsi meet website and git repo to implement it in native application. Some how once build command executed I am not able to find the framework in mentioned location. Neither am I able to identify the symbolic location (as suggested).

How can I get frameworks that I need to include in my native application in order to make jitsi meet video calling work?

JJJ
  • 32,902
  • 20
  • 89
  • 102
rptwsthi
  • 10,094
  • 10
  • 68
  • 109

2 Answers2

4

Create JITSI Meet Framework From react native Code:

  • Configure jitsi-meet react native application on your system run it and make it work
  • Open Xcode project run it on iOS device check if all works as is..
  • Build it cmd+b using Xcode (for generic device)

enter image description here

  • Inside app>Frameworks section click on

How to reach to jitsi.framwork that is needed to be included in your aplication

  • Copy “JitsiMeet.framework” file from here to your project folder

enter image description here

  • Copy “WebRTC.framework” file from path “jitsi-meet-master⁩ ▸ ⁨node_modules⁩ ▸ ⁨react-native-webrtc⁩ ▸ ⁨ios⁩” to your project folder

From where should I retrieve WebRTC framework

  • First Add these 2 to your framework then to embedded binaries

enter image description here

Other required details:

  • Bitcode is not supported, so turn it off for your project.
  • The SDK uses Swift code, so make sure you select Always Embed Swift Standard Libraries in your project.
  • Since the SDK requests camera and microphone access, make sure to include the required entries for NSCameraUsageDescription and NSMicrophoneUsageDescription in your Info.plist file.
  • Last, since the SDK shows and hides the status bar based on the conference state, you may want to set UIViewControllerBasedStatusBarAppearance to NO in your Info.plist file.

Simulator: Frame work exported in this way will not allow you to run application on Simulator. In order to run app on simulator build app with simulator selected and follow above steps.

Release:

  • When uploading your build to appstore you might face these issues:

enter image description here

  • In order to get rid of those, you will need to add a run script on your Xcode.

How to add Run Script

Script:

echo "Target architectures: $ARCHS"

APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"

find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
echo $(lipo -info "$FRAMEWORK_EXECUTABLE_PATH")

FRAMEWORK_TMP_PATH="$FRAMEWORK_EXECUTABLE_PATH-tmp"

# remove simulator's archs if location is not simulator's directory
case "${TARGET_BUILD_DIR}" in
*"iphonesimulator")
    echo "No need to remove archs"
    ;;
*)
    if $(lipo "$FRAMEWORK_EXECUTABLE_PATH" -verify_arch "i386") ; then
    lipo -output "$FRAMEWORK_TMP_PATH" -remove "i386" "$FRAMEWORK_EXECUTABLE_PATH"
    echo "i386 architecture removed"
    rm "$FRAMEWORK_EXECUTABLE_PATH"
    mv "$FRAMEWORK_TMP_PATH" "$FRAMEWORK_EXECUTABLE_PATH"
    fi
    if $(lipo "$FRAMEWORK_EXECUTABLE_PATH" -verify_arch "x86_64") ; then
    lipo -output "$FRAMEWORK_TMP_PATH" -remove "x86_64" "$FRAMEWORK_EXECUTABLE_PATH"
    echo "x86_64 architecture removed"
    rm "$FRAMEWORK_EXECUTABLE_PATH"
    mv "$FRAMEWORK_TMP_PATH" "$FRAMEWORK_EXECUTABLE_PATH"
    fi
    ;;
esac

echo "Completed for executable $FRAMEWORK_EXECUTABLE_PATH"
echo $(lipo -info "$FRAMEWORK_EXECUTABLE_PATH")

done

This script simply removes i386 and x86_64 slices from fat binary (if they exist) if running not for the simulator (that means destination folder isn't like "Debug-iphonesimulator"). Curtsy: https://stackoverflow.com/a/41416964/656600

References:

rptwsthi
  • 10,094
  • 10
  • 68
  • 109
0

Jitsi SDK Build Process:

  1. Clone or download the Jitsi sdk folder (React Native Project)
  2. Goto Jitsi folder
  3. npm install
  4. cd ios and do pod install
  5. Disable bitcode in project
  6. Change the bundle id (if require) and select proper certificate.
  7. run jitsi-meet.xcworkspace in Xcode , should compile and run fine
  8. Navigate to SDK folder location (Outside the iOS folder)
  9. Execute following commands in terminal:

mkdir -p ios/sdk/out

xcodebuild clean
-workspace ios/jitsi-meet.xcworkspace
-scheme JitsiMeetSDK

xcodebuild archive
-workspace ios/jitsi-meet.xcworkspace
-scheme JitsiMeetSDK
-configuration Release
-sdk iphonesimulator
-destination='generic/platform=iOS Simulator'
-archivePath ios/sdk/out/ios-simulator
VALID_ARCHS=x86_64
ENABLE_BITCODE=NO
SKIP_INSTALL=NO
BUILD_LIBRARY_FOR_DISTRIBUTION=YES

xcodebuild archive
-workspace ios/jitsi-meet.xcworkspace
-scheme JitsiMeetSDK
-configuration Release
-sdk iphoneos
-destination='generic/platform=iOS'
-archivePath ios/sdk/out/ios-device
VALID_ARCHS=arm64
ENABLE_BITCODE=NO
SKIP_INSTALL=NO
BUILD_LIBRARY_FOR_DISTRIBUTION=YES

xcodebuild -create-xcframework
-framework ios/sdk/out/ios-device.xcarchive/Products/Library/Frameworks/JitsiMeetSDK.framework
-framework ios/sdk/out/ios-simulator.xcarchive/Products/Library/Frameworks/JitsiMeetSDK.framework
-output ios/sdk/out/JitsiMeetSDK.xcframework

cp -a node_modules/react-native-webrtc/apple/WebRTC.xcframework ios/sdk/out

  1. After successfully building Jitsi Meet SDK for iOS, the 2 resulting XCFrameworks will be in the ios/sdk/out directory.
  2. Drag and drop respective frameworks in the project.
  3. Remember to change ENABLE_BITCODE to NO and Always Embed Swift Standard Libraries to YES
  4. Navigate to Targets > General and change the Frameworks, Libraries and Embed Content and change the Embed to Embed without signing or Embed with signing
  5. Now import JitsiMeetSDK in your view controller and you are good to go.

Reference: https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-ios-sdk

Sagar Sukode
  • 1,361
  • 12
  • 23