checkTrialOrIntroductoryPriceEligibility static method

Future<Map<String, IntroEligibility>> checkTrialOrIntroductoryPriceEligibility(
  1. List<String> productIdentifiers
)

iOS only. Computes whether or not a user is eligible for the introductory pricing period of a given product. You should use this method to determine whether or not you show the user the normal product price or the introductory price. This also applies to trials (trials are considered a type of introductory pricing).

@note Subscription groups are automatically collected for determining eligibility. If RevenueCat can't definitively compute the eligibility, most likely because of missing group information, it will return IntroEligibilityStatus.introEligibilityStatusUnknown. The best course of action on unknown status is to display the non-intro pricing, to not create a misleading situation. To avoid this, make sure you are testing with the latest version of iOS so that the subscription group can be collected by the SDK. Android always returns introEligibilityStatusUnknown.

productIdentifiers Array of product identifiers

Implementation

static Future<Map<String, IntroEligibility>>
    checkTrialOrIntroductoryPriceEligibility(
  List<String> productIdentifiers,
) async {
  final eligibilityMap = await _channel
      .invokeMethod('checkTrialOrIntroductoryPriceEligibility', {
    'productIdentifiers': productIdentifiers,
  });
  return Map<String, IntroEligibility>.from(
    eligibilityMap.map(
      (key, value) => MapEntry(
        key,
        IntroEligibility.fromJson(Map<String, dynamic>.from(value)),
      ),
    ),
  );
}