Hello,
I’m trying to run RevenueCat SDK on android and iOS from flutter and I have two questions.
This is my code for purchasing.
‘’’
makePurchase() async { try { PurchaserInfo purchaserInfo = await Purchases.purchasePackage(package); var isPro = purchaserInfo.entitlements.alle"test"]!.isActive; print('PRO : $isPro'); if (isPro) { print("이즈프로"); DataStorage().setPremiumUser(true); ShowSnackBar().getSnackBar(context, 'Thank you for purchasing.'); Navigator.of(context).pushAndRemoveUntil(MaterialPageRoute(builder: (context) => MainFrame()), (Route<dynamic> route) => false); } } on PlatformException catch (e) { showErrorMsg('Purchase error', e); }}
‘’’
- App was closed after the first purchase was successful.
I was testing on the Android device and the purchasing was successful. I can see the purchasing record from my Google play console. But the app was closed right after purchasing finished. The error seems occurred from the red line above (purchaserInfo.entitlements.allh“test”]!.isActive) because I couldn’t see the print log (‘PRO : $isPro’) next to the code.
Unfortunately I didn’t check the debug message and tried purchasing again. But in this time, it worked without any error and it keeps working now.
- I wonder what caused the error after the first purchase.
- And I'd like to test the first purchase situation again, is there a way to delete the purchase history?
- Can't see debug message on iOS simulator
I can see the debug message when I test on the real iPhone device but can’t see on simulator. I already added ‘OS_ACTIVITY_MODE’ enable on Xcode Environment variables. What should I do?
Thank you for your help!