Contacted support already about this issue and received a response asking me to try enabling debugging but I replied back to say that the code snippet I provided included this line
Purchases.setLogLevel(LogLevel.debug);
Which as far as I know enables debugging so it was already on. Two days on I never received another reply from support so I’m trying here.
I'm using the code below with revenue cat testing with a sandbox user in my flutter app. The apple in app purchase window appears, I purchase, input the password and it goes to the next screen to finish the purchase but I never actually see "Purchase successful. Ads removed!" printed. The public_sdk_key must be correct since the correct offerings are found. Of course the keys and IDs below are not the ones I'm using for testing, I am using the correct ones. I have created a non consumable in app purchase in app store connect and it's status is 'ready to submit'.
pubspec.yaml import = purchases_flutter: ^6.4.0
Offering? _offering;
@override
void initState() {
super.initState();
initPlatformState();
}
Future<void> initPlatformState() async {
Purchases.setLogLevel(LogLevel.debug);
Purchases.configure(PurchasesConfiguration("public_sdk_key")); //public_sdk_key = public API key
Offerings offerings = await Purchases.getOfferings();
if (offerings.current != null) {
setState(() {
_offering = offerings.current;
});
}
}
void makePurchase(Package package) async {
try {
print('try purchase');
CustomerInfo customerInfo = await Purchases.purchasePackage(package);
print("cannot reach here");
var isPro = customerInfo.entitlements.alle"pro_entitlement_id"]?.isActive ?? false; //pro_entitlement_id
if (isPro) {
print("Purchase successful. Ads removed!");
}
} on PlatformException catch (e) {
print("Purchase failed with error code: ${e.code}");
}
}
In the makePurchase function we see "try purchase" printed but we never see "cannot reach here" even and the popup to purchase simply re-appears asking us to try to purchase again. No error messages or debug messages are printed. I'm purchasing with this:
makePurchase(_offering!.lifetime!);
if I print print(_offering!.lifetime!); I get:
Package(identifier: $rc_lifetime, packageType: PackageType.lifetime, storeProduct: StoreProduct(identifier: rmv_ads, description: Remove permanently all ads from the app, title: Remove ads, price: 0.99, priceString: £0.99, currencyCode: GBP, introductoryPrice: null, discounts: ,], productCategory: ProductCategory.nonSubscription, defaultOption: null, subscriptionOptions: null, presentedOfferingIdentifier: null, subscriptionPeriod: null), offeringIdentifier: rmv_ads)