# FlutterPluginRegistry

Objective-C

    @protocol FlutterPluginRegistry <NSObject>

Swift

    protocol FlutterPluginRegistry : NSObjectProtocol

A registry of Flutter iOS plugins.

Plugins are identified by unique string keys, typically the name of the plugin’s main class. The registry tracks plugins by this key, mapping it to a value published by the plugin during registration, if any. This provides a very basic means of cross-plugin coordination with loose coupling between unrelated plugins.

Plugins typically need contextual information and the ability to register callbacks for various application events. To keep the API of the registry focused, these facilities are not provided directly by the registry, but by a `FlutterPluginRegistrar`, created by the registry in exchange for the unique key of the plugin.

There is no implied connection between the registry and the registrar. Specifically, callbacks registered by the plugin via the registrar may be relayed directly to the underlying iOS application objects.

- `-registrarForPlugin:`

  Returns a registrar for registering a plugin.

  #### Declaration

  Objective-C

      - (nullable NSObject<FlutterPluginRegistrar> *)registrarForPlugin:
          (nonnull NSString *)pluginKey;

  Swift

      func registrar(forPlugin pluginKey: String) -> FlutterPluginRegistrar?

  #### Parameters

  `pluginKey` | The unique key identifying the plugin.

- `-hasPlugin:`

  Returns whether the specified plugin has been registered.

  #### Declaration

  Objective-C

      - (BOOL)hasPlugin:(nonnull NSString *)pluginKey;

  Swift

      func hasPlugin(_ pluginKey: String) -> Bool

  #### Parameters

  `pluginKey` | The unique key identifying the plugin.

  #### Return Value

  `YES` if `registrarForPlugin` has been called with `pluginKey`.

- `-valuePublishedByPlugin:`

  Returns a value published by the specified plugin.

  #### Declaration

  Objective-C

      - (nullable NSObject *)valuePublishedByPlugin:(nonnull NSString *)pluginKey;

  Swift

      func valuePublished(byPlugin pluginKey: String) -> NSObject?

  #### Parameters

  `pluginKey` | The unique key identifying the plugin.

  #### Return Value

  An object published by the plugin, if any. Will be `NSNull` if nothing has been published. Will be `nil` if the plugin has not been registered.

© 2023 Flutter. All rights reserved. (Last updated: 2023-02-28)

Generated by jazzy ♪♫ v0.14.3, a Realm project.