connect static method

Future<bool> connect(
  1. String? inAppBillingKey, {
  2. VoidCallback? onDisconnected,
})

Initializes the connection between your app and the bazaar app

You must call this method before any other methods of this library. inAppBillingKey is the RSA key which you can find it in your (pishkhan panel)https://pishkhan.cafebazaar.ir. You can also disable the local security check (only if you are using Bazaar's REST API) by passing null as inAppBillingKey.

You should listen to onDisconnected callback and call FlutterPoolakey.connect to reconnect again.

This function may return an error, you should handle the error and check the stacktrace to resolve it.

Implementation

static Future<bool> connect(String? inAppBillingKey,
    {VoidCallback? onDisconnected}) async {
  _registerOnDisconnect(onDisconnected);
  return await _channel
      .invokeMethod('connect', {'in_app_billing_key': inAppBillingKey});
}