Search code examples
iosxcodejitsi

Create Jitsi Meet Framework for native iOS application and integrate in Xcode Project


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?


Solution

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