Skip to main content

Integrating with MacOS

info

This guide was written for flutter_rust_bridge v1, thus some content may be outdated. The quickest approach to integrate is to follow the one-click approach in flutter_rust_bridge's quickstart page.

The steps required to integrate with MacOS are identical to those of iOS, save for some minor details.

Adding the dummy header​

Flutter on MacOS does not inject headers by default, so you will notice the absence of macos/Runner/Runner-Bridging-Header.h in the MacOS project config. To fix this, in Build Settings, change Objective-C Bridging Header to be Runner/bridge_generated.h.

Using the dummy header​

Likewise, you will notice that in macos/Runner/AppDelegate.swift there is no func application anymore. It is sufficient to use dummy_method_to_enfore_binding anywhere in this file, as long as XCode does not consider it dead code.