Wise Flutter SDK - iOS Integration

1. Adding Zoom SDK

To run the meetings in iOS app, the Zoom SDK needs to integrated natively.

  1. Open your flutter_project/ios/Podfile and uncomment / set platform target as 13.0 (or greater)

platform :ios, '13.0'
  1. In terminal, navigate to flutter_project/ios folder and install pods

cd flutter_project/ios
pod install
  1. Open Runner.xcworkspace from ios folder.

  2. Download Zoom SDK iOS and unzip the file. The zip contains following files.

    MobileRTC.xcframework zoomcml.xcframework MobileRTCResources.bundle MobileRTCScreenShare.xcframework

  3. Move the lib folder into your project by dragging and dropping into xcode.

  1. Select Runner target and add MobileRTC.framework and zoomcml.xcframework to Frameworks Libraries and Embedded content

  1. Add MobileRTCResources.bundle to Build Phases → Copy Bundle Resources section.

  1. Make sure that the Build Phases order is as shown below.

  1. Add the required permissions to Runner → Info.plist file.

<key>NSBluetoothPeripheralUsageDescription</key>
<string>We will use your Bluetooth to access your Bluetooth headphones.</string>
<key>NSCameraUsageDescription</key>
<string>For people to see you during meetings, we need access to your camera.</string>
<key>NSMicrophoneUsageDescription</key>
<string>For people to hear you during meetings, we need access to your microphone.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>For people to share, we need access to your photos</string>
  1. Now add MobileRTC.framework to Pods → wisesdk → Frameworks Libraries and Embedded content.

  1. Keep the wisesdk → Build Phases order in following manner.

✅ At this point your can run your app and test the meeting.

2. Enabling Screen Share

To enable screen share during meetings, a Broast Upload Extension has to be added.

  1. Select Runner target and click on bottom + icon and select Broastcast Upload Extension

  1. Give the extension a name.

  1. Select newly created ScreenShare target and add MobileRTCScreenShare.xcframework to Frameworks & Libraries

  1. Select ScreenShare folder on left panel and go to File → New → File and select Objective-C file and proceed. Give the file a name and click on Create Bridge Header at the end.

  1. Once the bridge header file is created, you can delete the Objective-C file that is created.

  2. Open ScreenShare-Bridging-Header.h and add below code.

//
//  Use this file to import your target's public headers that you would like to expose to Swift.
//
#import <MobileRTCScreenShare/MobileRTCScreenShareService.h>
  1. Now open SampleHandler and add below content. Keep same group id that is used in flutter code.

import ReplayKit

class SampleHandler: RPBroadcastSampleHandler, MobileRTCScreenShareServiceDelegate {
    
    var screenShareService: MobileRTCScreenShareService?
    
    override init() {
        super.init()
        
        screenShareService = MobileRTCScreenShareService()
        screenShareService?.appGroup = "group.com.example.wiseSdkTest.ScreenShare"
        screenShareService?.delegate = self
    }
    
    override func broadcastStarted(withSetupInfo setupInfo: [String : NSObject]?) {
        // User has requested to start the broadcast. Setup info from the UI extension can be supplied but optional.
        screenShareService?.broadcastStarted(withSetupInfo: setupInfo)
    }
    
    override func broadcastPaused() {
        // User has requested to pause the broadcast. Samples will stop being delivered.
        screenShareService?.broadcastPaused()
    }
    
    override func broadcastResumed() {
        // User has requested to resume the broadcast. Samples delivery will resume.
        screenShareService?.broadcastResumed()
    }
    
    override func broadcastFinished() {
        // User has requested to finish the broadcast.
        screenShareService?.broadcastFinished()
    }
    
    override func processSampleBuffer(_ sampleBuffer: CMSampleBuffer, with sampleBufferType: RPSampleBufferType) {
        screenShareService?.processSampleBuffer(sampleBuffer, with: sampleBufferType)
    }
    
    func mobileRTCScreenShareServiceFinishBroadcastWithError(_ error: Error!) {
        finishBroadcastWithError(error)
    }
}
  1. Select Runnder, select Signing & Capabilities tab, click Capability and add App Group.

  1. Do the same for ScreenShare extension also. In summary, both the Runner and ScreenShare should have same group Id.

  1. Select ScreenShare → Build Settings → Other Linker Flags and -lc++ flag.

  1. Add the below frameworks to ScreenShare → Build Phase → Link Binary with Libraries

CoreGraphics.framework

CoreVideo.framework

CoreMedia.framework

VideoToolbox.framework

✅ Now you can run the app and test the Screen Share option in the meeting.

Last updated