Проблема с покупкой Revenuecat во Flutter iOSIOS

Программируем под IOS
Ответить
Anonymous
 Проблема с покупкой Revenuecat во Flutter iOS

Сообщение Anonymous »

Код: Выделить всё

static Future fetchAndPurchaseLifetimeAccess() async {
try {
// Fetch offerings
Offerings offerings = await Purchases.getOfferings();
Offering? offering = offerings.current;
//Printing offerings
offerings.all.forEach(
(key, value) {
print("Offerings are ; $key : $value");
},
);
// Check if lifetime package is available
if (offering != null && offering.lifetime != null) {
debugPrint('Found Lifetime Offering');
// Purchase the lifetime package
CustomerInfo purchaserInfo =
await Purchases.purchasePackage(offering.lifetime!);
// Check if the entitlement is active
if (purchaserInfo.entitlements.all["zsp2_id"]?.isActive == true) {
debugPrint("Lifetime access granted!");

SharedPreferences prefs = await SharedPreferences.getInstance();
// Save premium info on SharedPref
await prefs.setBool('isPremium', true);
return true;
}
} else {
debugPrint("Lifetime package not available.");
}
} catch (e) {
debugPrint("Error purchasing: $e");
}
return false;
}
Вывод:

Код: Выделить всё

flutter: Trying to purchase
flutter: Error purchasing: PlatformException(23, There is an issue with your configuration. Check the underlying error for more details. There's a problem with your configuration. None of the products registered in the RevenueCat dashboard could be fetched from App Store Connect (or the StoreKit Configuration file if one is being used).
flutter: More information: https://rev.cat/why-are-offerings-empty, {readable_error_code: CONFIGURATION_ERROR, underlyingErrorMessage: , message: There is an issue with your configuration. Check the underlying error for more details. There's a problem with your configuration. None of the products registered in the RevenueCat dashboard could be fetched from App Store Connect (or the StoreKit Configuration file if one is being used).
flutter: More information: https://rev.cat/why-are-offerings-empty, code: 23, readableErrorCode: CONFIGURATION_ERROR}, null)
Что здесь не так?
Настройка Revenuecat iOS в документации немного запутанна.

Подробнее здесь: https://stackoverflow.com/questions/792 ... lutter-ios
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «IOS»