Flutter Engine
The Flutter Engine
Instance Methods | Class Methods | List of all members
<FlutterPlugin> Protocol Reference

#import <FlutterPlugin.h>

Inheritance diagram for <FlutterPlugin>:
<FlutterApplicationLifeCycleDelegate> <FlutterAppLifecycleDelegate> ContinuousTexture FakeAppDelegatePlugin FlutterMenuPlugin FlutterMouseCursorPlugin

Instance Methods

(void) - handleMethodCall:result:
 
(void) - detachFromEngineForRegistrar:
 
(void) - handleMethodCall:result:
 
- Instance Methods inherited from <FlutterApplicationLifeCycleDelegate>
(BOOL- application:didFinishLaunchingWithOptions:
 
(BOOL- application:willFinishLaunchingWithOptions:
 
(void) - applicationDidBecomeActive:
 
(void) - applicationWillResignActive:
 
(void) - applicationDidEnterBackground:
 
(void) - applicationWillEnterForeground:
 
(void) - applicationWillTerminate:
 
(void) - application:didRegisterUserNotificationSettings:
 
(void) - application:didRegisterForRemoteNotificationsWithDeviceToken:
 
(void) - application:didFailToRegisterForRemoteNotificationsWithError:
 
(BOOL- application:didReceiveRemoteNotification:fetchCompletionHandler:
 
(void) - application:didReceiveLocalNotification:
 
(BOOL- application:openURL:options:
 
(BOOL- application:handleOpenURL:
 
(BOOL- application:openURL:sourceApplication:annotation:
 
(BOOL- application:performActionForShortcutItem:completionHandler:
 
(BOOL- application:handleEventsForBackgroundURLSession:completionHandler:
 
(BOOL- application:performFetchWithCompletionHandler:
 
(BOOL- application:continueUserActivity:restorationHandler:
 
- Instance Methods inherited from <FlutterAppLifecycleDelegate>
(void) - handleWillFinishLaunching:
 
(void) - handleDidFinishLaunching:
 
(void) - handleWillBecomeActive:
 
(void) - handleDidBecomeActive:
 
(void) - handleWillResignActive:
 
(void) - handleDidResignActive:
 
(void) - handleWillHide:
 
(void) - handleDidHide:
 
(void) - handleWillUnhide:
 
(void) - handleDidUnhide:
 
(void) - handleDidChangeScreenParameters:
 
(void) - handleDidChangeOcclusionState:
 
(BOOL- handleOpenURLs:
 
(void) - handleWillTerminate:
 

Class Methods

(void) + registerWithRegistrar:
 
(void) + setPluginRegistrantCallback:
 
(void) + registerWithRegistrar:
 

Detailed Description

Implemented by the iOS part of a Flutter plugin.

Defines a set of optional callback methods and a method to set up the plugin and register it to be called by other application components.

Implemented by the platform side of a Flutter plugin.

Defines a set of optional callback methods and a method to set up the plugin and register it to be called by other application components.

Currently the macOS version of FlutterPlugin has very limited functionality, but is expected to expand over time to more closely match the functionality of the iOS FlutterPlugin.

Definition at line 189 of file FlutterPlugin.h.

Method Documentation

◆ detachFromEngineForRegistrar:

- (void) detachFromEngineForRegistrar: (NSObject< FlutterPluginRegistrar > *)  registrar
optional

Called when a plugin is being removed from a FlutterEngine, which is usually the result of the FlutterEngine being deallocated. This method provides the opportunity to do necessary cleanup.

You will only receive this method if you registered your plugin instance with the FlutterEngine via -[FlutterPluginRegistry publish:].

Parameters
registrarThe registrar that was used to publish the plugin.

◆ handleMethodCall:result: [1/2]

- (void) handleMethodCall: (FlutterMethodCall *)  call
result: (FlutterResult result 
optional

Called if this plugin has been registered to receive FlutterMethodCalls.

Parameters
callThe method call command object.
resultA callback for submitting the result of the call.

Reimplemented in FlutterMenuPlugin, and FlutterMouseCursorPlugin.

◆ handleMethodCall:result: [2/2]

- (void) handleMethodCall: (FlutterMethodCall *)  call
result: (FlutterResult result 
optional

Called when a message is sent from Flutter on a channel that a plugin instance has subscribed to via -[FlutterPluginRegistrar addMethodCallDelegate:channel:].

The |result| callback must be called exactly once, with one of:

  • FlutterMethodNotImplemented, if the method call is unknown.
  • A FlutterError, if the method call was understood but there was a problem handling it.
  • Any other value (including nil) to indicate success. The value will be returned to the Flutter caller, and must be serializable to JSON.

Reimplemented in FlutterMenuPlugin, and FlutterMouseCursorPlugin.

◆ registerWithRegistrar: [1/2]

+ (void) registerWithRegistrar: (id< FlutterPluginRegistrar >)  registrar

Creates an instance of the plugin to register with |registrar| using the desired FlutterPluginRegistrar methods.

Reimplemented in FakeAppDelegatePlugin, and FlutterMouseCursorPlugin.

◆ registerWithRegistrar: [2/2]

+ (void) registerWithRegistrar: (NSObject< FlutterPluginRegistrar > *)  registrar
staticrequired

Registers this plugin using the context information and callback registration methods exposed by the given registrar.

The registrar is obtained from a FlutterPluginRegistry which keeps track of the identity of registered plugins and provides basic support for cross-plugin coordination.

The caller of this method, a plugin registrant, is usually autogenerated by Flutter tooling based on declared plugin dependencies. The generated registrant asks the registry for a registrar for each plugin, and calls this method to allow the plugin to initialize itself and register callbacks with application objects available through the registrar protocol.

Parameters
registrarA helper providing application context and methods for registering callbacks.

◆ setPluginRegistrantCallback:

+ (void) setPluginRegistrantCallback: (FlutterPluginRegistrantCallback callback
staticoptional

Set a callback for registering plugins to an additional FlutterPluginRegistry, including headless FlutterEngine instances.

This method is typically called from within an application's AppDelegate at startup to allow for plugins which create additional FlutterEngine instances to register the application's plugins.

Parameters
callbackA callback for registering some set of plugins with a FlutterPluginRegistry.

The documentation for this protocol was generated from the following files: