getProductsWithType static method

Future<ProductsResponse> getProductsWithType(
  1. String type
)

Fetches the filtered products with specified type from appmate server. If sandbox parameter value is false, non-synched products will not be fetched

If a previous successful fetch exists in last 10 minutes, it fetches the products from local cache. So you will be able to get the response faster than getting directly from the network. Otherwise, it will launch a network request.

If you add a new product and want to see it in your app for testing purposes, you can delete your app's cache. The products will be fetched from the network the next time you open your app.

type of products as String. It must be typed as "0" for consumables, "1" for non-consumables and "2" for subscriptions.

Callbacks ProductsResponse and GenericError in case of failure.

Implementation

static Future<ProductsResponse> getProductsWithType(String type) async {
  final List<Object?>? response =
      await _channel.invokeMethod('getProductsWithType', {"type": type});
  return _getProductsFromResponse(response);
}