grantPromotional static method

Future<bool> grantPromotional({
  1. required int daysCount,
  2. String? productId,
  3. ApphudGroup? group,
})

You can grant free promotional subscription to user. Returns true in a callback if promotional was granted.

You should pass either productId (recommended) or permissionGroup OR both parameters null. Sending both productId and permissionGroup parameters will result in productId being used.

  • parameter daysCount is required. Number of days of free premium usage. For lifetime promotionals just pass extremely high value, like 10000.
  • parameter productId is optional. Recommended. Product Id of promotional subscription.
  • parameter permissionGroup is optional. Permission Group of promotional subscription. Use this parameter in case you have multiple permission groups.

Implementation

static Future<bool> grantPromotional({
  required int daysCount,
  String? productId,
  ApphudGroup? group,
}) async {
  final bool? value = await _channel.invokeMethod<bool>(
    'grantPromotional',
    {
      'daysCount': daysCount,
      'productId': productId,
      'permissionGroupName': group?.name,
    },
  );
  return value!;
}