batch_flutter Documentation

Class Batch​Flutter​Plugin

@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.

BatchFlutterPlugin BatchFlutterPlugin FlutterPlugin FlutterPlugin BatchFlutterPlugin->FlutterPlugin NSObject NSObject BatchFlutterPlugin->NSObject

Conforms To

FlutterPlugin
NSObject

Properties

configuration

public private(set) static var configuration: BatchPluginConfiguration  

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.

manage​Batch​Lifecycle

public static var manageBatchLifecycle: Bool = true

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.

Methods

register(with:​)

public static func register(with registrar: FlutterPluginRegistrar)  

handle(_:​result:​)

public func handle(_ call: FlutterMethodCall, result flutterResult: @escaping FlutterResult)  

setup()

@discardableResult
    public static func setup() -> 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.

Returns

True if the plugin was setup, false othwersie. Returns true on any subsequent call if one setup call succeeded.