@fred
Can you share the values you are getting?
I’m getting the same problem in flutter, the intro price should be 3 months but it shows 1 year (that is the subscription lifetime). I don’t have the values since it is in production and I don’t know the way of testing it in a different environment or how to get the values in production app
@ricardo-6e38b7
What version of flutter are you using?
@ricardo-6e38b7
What version of flutter are you using?
flutter --version
Flutter 3.10.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 796c8ef792 (12 days ago) • 2023-06-13 15:51:02 -0700
Engine • revision 45f6e00911
Tools • Dart 3.0.5 • DevTools 2.23.1
Sorry, I meant, what version of RevenueCat SDK are you using?
Sorry, I meant, what version of RevenueCat SDK are you using?
purchases_flutter: ^5.1.0
This is my current code:
final String result = _remoteConfig.getString('revenuecat_offering_id');
final Offerings offerings = await Purchases.getOfferings();
final Offering? foundOffering = offerings.getOffering(result);
final Offering? offering = foundOffering ?? offerings.current;
final purchaseUser = await Purchases.getCustomerInfo();
final bool canUserHaveFreeTrial;
if (Platform.isIOS) {
final mapEligibility =
await Purchases.checkTrialOrIntroductoryPriceEligibility(
purchaseUser.entitlements.all.keys.toList());
canUserHaveFreeTrial = mapEligibility.values.any((element) =>
element.status ==
IntroEligibilityStatus.introEligibilityStatusEligible);
} else {
// user has had access to an entitlement which means
// they're not eligible for the offer
// or
// user has never had access to any entitlements
// show intro offer
canUserHaveFreeTrial = purchaseUser.entitlements.all.isEmpty;
}
if (offering != null) {
final List<Package> packages = offering.availablePackages;
final sortedPrices = _sortPrices(packages);
final int selectedIndex = _findIndexWithBiggestDiscount(sortedPrices);
emit(PaywallLoadSuccess(
packages: sortedPrices,
selectedIndex: selectedIndex,
canUserHaveIntroPrice: canUserHaveFreeTrial,
));
}
Here is my widget:
Visibility(
visible: state.canUserHaveIntroPrice,
replacement: ElevatedButton(
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(18.0),
),
minimumSize: const Size(double.infinity, 45),
),
child: Text(
S.of(context).supermarketBtnContinue,
style: const TextStyle(
fontSize: 20,
),
),
onPressed: () {
_bloc.add(PaywallPaymentRequest(
product: selectedProduct,
));
},
),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(18.0),
),
minimumSize: const Size(double.infinity, 45),
),
child: Text(
_paymentButtonText(
selectedProduct.introductoryPrice),
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 20,
),
),
onPressed: () {
_bloc.add(PaywallPaymentRequest(
product: selectedProduct,
));
},
),
),
This is the method that the widget uses:
String _paymentButtonText(final IntroductoryPrice? introductoryPrice) {
if (introductoryPrice != null) {
final translatedPeriod = _translatePeriodUnit(
introductoryPrice.periodUnit, introductoryPrice.cycles);
final periodString = '${introductoryPrice.cycles} '
'$translatedPeriod'
.toLowerCase();
return S.of(context).paywallTxtFreeTrial(periodString);
}
return S.of(context).supermarketBtnContinue;
}
@ricardo-6e38b7 I saw you posted the issue here → https://github.com/RevenueCat/purchases-flutter/issues/743, I’ll ask somebody from the team to see if they can reproduce the issue.
@ricardo-6e38b7 I saw you posted the issue here → https://github.com/RevenueCat/purchases-flutter/issues/743, I’ll ask somebody from the team to see if they can reproduce the issue.
Yes, I hope I posted enough information, please let me know if you need more :)
@ricardo-6e38b7 Release with a fix coming soon
This seems to be the issue - https://github.com/RevenueCat/purchases-hybrid-common/pull/446
@ricardo-6e38b7 Release with a fix coming soon
This seems to be the issue - https://github.com/RevenueCat/purchases-hybrid-common/pull/446
Hey, I just updated my revenuecat dependency, and I’m going to release a new version of my app and let you know if everything goes fine . Thank you for your quickly deploy.
Sorry, I’m late. It seems that you have identified the issue. As a workaround, we added a different logic for Android using subscribe by subscription option and finding if there’s any free phase, but it seems that you have fixed this in the latest version. We’ll try this in the next version to make our iOS and Android code consistent and let you know how it goes.
Thank you!