Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mdjastrzebski/c928c6e1149138070bc138642e1663f6 to your computer and use it in GitHub Desktop.
Save mdjastrzebski/c928c6e1149138070bc138642e1663f6 to your computer and use it in GitHub Desktop.
import Flutter
import React
import UIKit
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
// ...
GeneratedPluginRegistrant.register(with: self)
// Register FLReactViewFactory with Flutter engine.
// See: https://docs.flutter.dev/platform-integration/ios/platform-views
guard let pluginRegistrar = self.registrar(forPlugin: "plugin-name") else {
return false
}
pluginRegistrar.register(
FLReactViewFactory(messenger: pluginRegistrar.messenger()),
withId: "react_view"
)
BridgeManager.shared.loadReactNative(launchOptions: launchOptions)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment