init static method

Future<void> init()

Implementation

static Future<void> init() async {
  if (kDebugMode && !DEBUG) {
    return;
  }

  if (NO_PURCHASE_ANDROID && isAndroid) {
    setPremium(true);
    return;
  }

  Storekit2Helper.initialize();

  var hasActiveSubscription = await Storekit2Helper.hasActiveSubscription();

  if (RemoteConfig.get("all_premium", false)) {
    hasActiveSubscription = true;
  }

  setPremium(hasActiveSubscription);

  if (hasActiveSubscription) {
    return;
  }
  products = await Storekit2Helper.fetchProducts(productsIds);

  setAsaData();
}