init method

Future<CustomerInfo?> init({
  1. CustomerInfo? customerInfo,
})

Implementation

Future<CustomerInfo?> init({CustomerInfo? customerInfo}) async {
  addCustomerInfoUpdateListener((customerInfo) {
    _updateState(entitlementId, customerInfo);
  });

  try {
    final info = customerInfo ?? await this.customerInfo;
    _updateState(entitlementId, info);
    return info;
  } catch (e) {
    return null;
  }
}