Package com.batch.batch_flutter
Class BatchFlutterPlugin
java.lang.Object
com.batch.batch_flutter.BatchFlutterPlugin
- All Implemented Interfaces:
io.flutter.embedding.engine.plugins.activity.ActivityAware,io.flutter.embedding.engine.plugins.FlutterPlugin,io.flutter.plugin.common.MethodChannel.MethodCallHandler,io.flutter.plugin.common.PluginRegistry.NewIntentListener
public class BatchFlutterPlugin
extends Object
implements io.flutter.embedding.engine.plugins.FlutterPlugin, io.flutter.plugin.common.MethodChannel.MethodCallHandler, io.flutter.embedding.engine.plugins.activity.ActivityAware, io.flutter.plugin.common.PluginRegistry.NewIntentListener
BatchFlutterPlugin
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.flutter.embedding.engine.plugins.FlutterPlugin
io.flutter.embedding.engine.plugins.FlutterPlugin.FlutterAssets, io.flutter.embedding.engine.plugins.FlutterPlugin.FlutterPluginBinding -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BatchPluginConfigurationgetConfiguration(Context context) Get the plugin configuration object.protected booleanisSetup()voidonAttachedToActivity(io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding binding) voidonAttachedToEngine(io.flutter.embedding.engine.plugins.FlutterPlugin.FlutterPluginBinding flutterPluginBinding) voidvoidvoidonDetachedFromEngine(io.flutter.embedding.engine.plugins.FlutterPlugin.FlutterPluginBinding binding) voidonMethodCall(io.flutter.plugin.common.MethodCall call, io.flutter.plugin.common.MethodChannel.Result result) booleanonNewIntent(Intent intent) voidonReattachedToActivityForConfigChanges(io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding binding) static voidsetManageActivityLifecycle(boolean manageActivityLifecycle) Set whether BatchFlutterPlugin should automatically manage Batch's activity lifecycle (as in automatically callingBatch.onStart(Activity)and so on).static booleanReady the plugin for use.
-
Field Details
-
currentActivity
-
-
Constructor Details
-
BatchFlutterPlugin
public BatchFlutterPlugin()
-
-
Method Details
-
isSetup
@VisibleForTesting protected boolean isSetup() -
onAttachedToEngine
public void onAttachedToEngine(@NonNull io.flutter.embedding.engine.plugins.FlutterPlugin.FlutterPluginBinding flutterPluginBinding) - Specified by:
onAttachedToEnginein interfaceio.flutter.embedding.engine.plugins.FlutterPlugin
-
onDetachedFromEngine
public void onDetachedFromEngine(@NonNull io.flutter.embedding.engine.plugins.FlutterPlugin.FlutterPluginBinding binding) - Specified by:
onDetachedFromEnginein interfaceio.flutter.embedding.engine.plugins.FlutterPlugin
-
onMethodCall
public void onMethodCall(@NonNull io.flutter.plugin.common.MethodCall call, @NonNull io.flutter.plugin.common.MethodChannel.Result result) - Specified by:
onMethodCallin interfaceio.flutter.plugin.common.MethodChannel.MethodCallHandler
-
onAttachedToActivity
public void onAttachedToActivity(@NonNull io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding binding) - Specified by:
onAttachedToActivityin interfaceio.flutter.embedding.engine.plugins.activity.ActivityAware
-
onReattachedToActivityForConfigChanges
public void onReattachedToActivityForConfigChanges(@NonNull io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding binding) - Specified by:
onReattachedToActivityForConfigChangesin interfaceio.flutter.embedding.engine.plugins.activity.ActivityAware
-
onDetachedFromActivity
public void onDetachedFromActivity()- Specified by:
onDetachedFromActivityin interfaceio.flutter.embedding.engine.plugins.activity.ActivityAware
-
onDetachedFromActivityForConfigChanges
public void onDetachedFromActivityForConfigChanges()- Specified by:
onDetachedFromActivityForConfigChangesin interfaceio.flutter.embedding.engine.plugins.activity.ActivityAware
-
onNewIntent
- Specified by:
onNewIntentin interfaceio.flutter.plugin.common.PluginRegistry.NewIntentListener
-
setup
Ready the plugin for use. This MUST be called in anApplicationsubclass'Application.onCreate().Once setup success fully, the configuration cannot be changed anymore as this calls
Batch.start(String)Note: If setup has never been called, or if Batch wasn't provided an APIKey in the manifest or using
getConfiguration(Context)andBatchPluginConfiguration.setAPIKey(String), any method call will throw an exception.- Returns:
- Whether the plugin was successfully setup. Returns true on any subsequent call if one setup call succeeded.
-
getConfiguration
Get the plugin configuration object. It will be initialized with the previous values, including what has been read from the manifest.Once
setup(Context)has been called, changing values in the returned object will not have any effect. -
setManageActivityLifecycle
public static void setManageActivityLifecycle(boolean manageActivityLifecycle) Set whether BatchFlutterPlugin should automatically manage Batch's activity lifecycle (as in automatically callingBatch.onStart(Activity)and so on).If you add batch_flutter in a hybrid application (one that mixes native android activities with flutter ones), you should turn this off and register
BatchActivityLifecycleHelperin yourApplicationsubclass.
-