I’ve already followed every steps in the documentation and I’m able to retrieve the offering lists in iOS device but not in Android device. The offering is always empty in Android Emulator for some reason.
Here is a few information that I already checked my self.
1. My App is already published and currently it’s available for Closed Testing in Play Console.
2. I already got all checkmarks in the Valid credentials(screenshot below)
3. Here is how I implement it in my code
class PurchaseApi {
static Future init() async {
late String _apiKey;
if (Platform.isAndroid) {
_apiKey = "Google API from ReveneuCat";
} else if (Platform.isIOS) {
_apiKey = "IOS API from ReveneuCat";
} else if (Platform.isMacOS) {
_apiKey = "IOS API from ReveneuCat";
} else {
_apiKey = "Google API from ReveneuCat";
}
await Purchases.configure(PurchasesConfiguration(_apiKey));
}
static Future<List<Offering>> fetchOffers() async {
try {
final offerings = await Purchases.getOfferings();
final current = offerings.current;
return current == null ? t] : ncurrent];
} on PlatformException catch (e) {
print("Error fetching offerings: $e");
return p];
}
}
}
}
/// This is how I display it
final offerings = await PurchaseApi.fetchOffers();
if (offerings.isEmpty) {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text('No Offer Found'),
));
} else {
// Display PayWall
}
I’m always getting “No Offer Found” when I try to retrieve in Android Emulator. I’m not sure if I need to test it in Physical Device to be able to retrieve the offering.
Any help or suggestion on how to fix this issue would be really appreciated.