static Future fetchAndPurchaseLifetimeAccess() async {
attempt {
// Fetch choices
Choices choices = await Purchases.getOfferings();
Providing? providing = choices.present;
//Printing choices
choices.all.forEach(
(key, worth) {
print("Choices are ; $key : $worth");
},
);
// Test if lifetime package deal is accessible
if (providing != null && providing.lifetime != null) {
debugPrint('Discovered Lifetime Providing');
// Buy the lifetime package deal
CustomerInfo purchaserInfo =
await Purchases.purchasePackage(providing.lifetime!);
// Test if the entitlement is energetic
if (purchaserInfo.entitlements.all["zsp2_id"]?.isActive == true) {
debugPrint("Lifetime entry granted!");
SharedPreferences prefs = await SharedPreferences.getInstance();
// Save premium data on SharedPref
await prefs.setBool('isPremium', true);
return true;
}
} else {
debugPrint("Lifetime package deal not out there.");
}
} catch (e) {
debugPrint("Error buying: $e");
}
return false;
}
flutter: Attempting to buy
flutter: Error buying: PlatformException(23, There is a matter along with your configuration. Test the underlying error for extra particulars. There's an issue along with your configuration. Not one of the merchandise registered within the RevenueCat dashboard might be fetched from App Retailer Join (or the StoreKit Configuration file if one is getting used).
flutter: Extra info: https://rev.cat/why-are-offerings-empty, {readable_error_code: CONFIGURATION_ERROR, underlyingErrorMessage: , message: There is a matter along with your configuration. Test the underlying error for extra particulars. There's an issue along with your configuration. Not one of the merchandise registered within the RevenueCat dashboard might be fetched from App Retailer Join (or the StoreKit Configuration file if one is getting used).
flutter: Extra info: https://rev.cat/why-are-offerings-empty, code: 23, readableErrorCode: CONFIGURATION_ERROR}, null)
What’s fallacious right here?
Revenuecat iOS setup in documentation is little bit complicated.