🚨 MANDATORY PRE-SUBMISSION CHECKLIST
✅ Checklist
📱 Example Project Reference
Example Code Review
❓ Your Question
What would you like to know? Please be specific.
In ProductSubscriptionIOS implementation, the documentation comments say that discountsIOS is deprecated and subscriptionOffers should be used instead.
💻 Current Code
/lib/types.dart
...
/// @deprecated Use subscriptionOffers instead for cross-platform compatibility.
final List<DiscountIOS>? discountsIOS;
...
/// @deprecated Use subscriptionOffers instead for cross-platform compatibility.
final SubscriptionInfoIOS? subscriptionInfoIOS;
However, in parseProductFromNative() implementation, the subscriptionInfoIOS is missing in ProductSubscriptionIOS instantiation.
/lib/flutter_inapp_purchase.dart
gentype.ProductCommon parseProductFromNative(
Map<String, dynamic> json,
String type, {
required bool fallbackIsIOS,
}) {
...
if (productType == gentype.ProductType.Subs) {
if (platform == gentype.IapPlatform.IOS) {
return gentype.ProductSubscriptionIOS(
currency: currency,
description: description,
displayNameIOS: json['displayNameIOS']?.toString() ?? title,
displayPrice: displayPrice,
id: productId,
isFamilyShareableIOS: json['isFamilyShareableIOS'] as bool? ?? false,
jsonRepresentationIOS:
json['jsonRepresentationIOS']?.toString() ?? '{}',
platform: platform,
title: title,
type: productType,
typeIOS: _parseProductTypeIOS(json['typeIOS']?.toString()),
debugDescription: json['debugDescription']?.toString(),
// Only discountsIOS is provided
discountsIOS: _parseDiscountsIOS(
json['discountsIOS'] ?? json['discounts'],
),
displayName: json['displayName']?.toString(),
introductoryPriceAsAmountIOS:
json['introductoryPriceAsAmountIOS']?.toString(),
introductoryPriceIOS: json['introductoryPriceIOS']?.toString(),
introductoryPriceNumberOfPeriodsIOS:
json['introductoryPriceNumberOfPeriodsIOS']?.toString(),
introductoryPricePaymentModeIOS: _parsePaymentMode(
json['introductoryPricePaymentModeIOS'],
),
introductoryPriceSubscriptionPeriodIOS: _parseSubscriptionPeriod(
json['introductoryPriceSubscriptionPeriodIOS'],
),
price: priceValue,
subscriptionInfoIOS: _parseSubscriptionInfoIOS(
json['subscriptionInfoIOS'] ?? json['subscription'],
),
subscriptionPeriodNumberIOS:
json['subscriptionPeriodNumberIOS']?.toString(),
subscriptionPeriodUnitIOS: _parseSubscriptionPeriod(
json['subscriptionPeriodUnitIOS'],
),
);
}
...
}
...
}
📱 Environment
Package version:
- flutter_inapp_purchase: ^8.2.6
Platform:
🚨 MANDATORY PRE-SUBMISSION CHECKLIST
✅ Checklist
example/project?/example/lib/main.dart📱 Example Project Reference
Example Code Review
❓ Your Question
In
ProductSubscriptionIOSimplementation, the documentation comments say thatdiscountsIOSis deprecated andsubscriptionOffersshould be used instead.💻 Current Code
/lib/types.dartHowever, in
parseProductFromNative()implementation, thesubscriptionInfoIOSis missing inProductSubscriptionIOSinstantiation./lib/flutter_inapp_purchase.dart// Paste your code here📱 Environment
Package version:
Platform: