I am not able to fetch the products from revenuecat. the issue is that when i try to fetch the products, i get an empty array.
there are products as show in pictures, what am i doing wrong?
here is the main code::
Future<void> main() async {
await dotenv.load();
WidgetsFlutterBinding.ensureInitialized();
RevenueCat.init();
await Firebase.initializeApp(
name: "thraive-5f2ab",
options: DefaultFirebaseOptions.currentPlatform,
);
here is the class that I am using::
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:purchases_flutter/models/offerings_wrapper.dart';
import 'package:purchases_flutter/purchases_flutter.dart';
class RevenueCat {
static final _apiKey = dotenv.env['REVENUE_CAT_API_KEY']!;
static Future init() async {
// await Purchases.setDebugLogsEnabled(true);
// await Purchases.setup(_apiKey);
final revenueCat =
PurchasesConfiguration(dotenv.env['REVENUE_CAT_API_KEY']!);
await Purchases.configure(revenueCat);
}
static Future<List<Offering>> fetchOffers() async {
try {
final offerings = await Purchases.getOfferings();
final current = offerings.current;
return current == null ? [] : [current];
} catch (e) {
return [];
}
}
}
here is the revenue dashboard::
here is the entitlement dash::
identifier used::
offerings used::