Complete rewrite from stub plugin to (probably) functional liblinphone integration featuring: - Core SDK bridge with registration, calls, and media controls - Platform views for remote and local video rendering - Event channels for registration and call state updates
32 lines
964 B
Swift
32 lines
964 B
Swift
import Flutter
|
|
import UIKit
|
|
|
|
class RemoteViewFactory: NSObject, FlutterPlatformViewFactory {
|
|
private var messenger: FlutterBinaryMessenger
|
|
private var cacher: (UIView) -> Void
|
|
|
|
init(messenger: FlutterBinaryMessenger, cacher: @escaping (UIView) -> Void) {
|
|
self.messenger = messenger
|
|
self.cacher = cacher
|
|
super.init()
|
|
}
|
|
|
|
func create(
|
|
withFrame frame: CGRect,
|
|
viewIdentifier viewId: Int64,
|
|
arguments args: Any?
|
|
) -> FlutterPlatformView {
|
|
return RemoteView(
|
|
frame: frame,
|
|
viewIdentifier: viewId,
|
|
arguments: args,
|
|
binaryMessenger: messenger,
|
|
cacher: cacher
|
|
)
|
|
}
|
|
|
|
/// Implementing this method is only necessary when the `arguments` in `createWithFrame` is not `nil`.
|
|
public func createArgsCodec() -> FlutterMessageCodec & NSObjectProtocol {
|
|
return FlutterStandardMessageCodec.sharedInstance()
|
|
}
|
|
}
|