BatchFlutterPlugin
@objc
public class BatchFlutterPlugin : NSObject, FlutterPlugin
Batch’s Flutter Plugin main class.
BatchFlutterPlugin.setup()
needs be called in
See configuration
and manageBatchLifecycle
for more info on how to configure it.
-
Undocumented
Declaration
Swift
public static func register(with registrar: FlutterPluginRegistrar)
-
Undocumented
Declaration
Swift
public func handle(_ call: FlutterMethodCall, result flutterResult: @escaping FlutterResult)
-
Get the plugin configuration object. It will be initialized with fallback default values.
Once
setup()
has been called, changing values in the object returned by thris property will not have any effect.Declaration
Swift
@MainActor public private(set) static var configuration: BatchPluginConfiguration { get }
-
Set whether BatchFlutterPlugin should automatically manage Batch’s lifecycle, as in automatically start.
If you add batch_flutter in a hybrid application, you should turn this off and start/configure Batch natively.
Declaration
Swift
@MainActor public static var manageBatchLifecycle: Bool
-
Prepare Batch’s Flutter Plugin for use. This must be called in
application(_:didFinishLaunchingWithOptions:)
. Failure to do so will throw exceptions on the Flutter side of the plugin.Once setup succeeds, the configuration cannot be changed using the
configuration
property anymore.If
manageBatchLifecycle
is true, this method will start Batch and refresh the push token.Declaration
Swift
@discardableResult @MainActor public static func setup() -> Bool
Return Value
True if the plugin was setup, false othwersie. Returns true on any subsequent call if one setup call succeeded.