Solved

1.App was closed after the first purchase was successful . 2. Can't see debug message on iOS simulator

  • 14 August 2021
  • 1 reply
  • 27 views

Badge

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.all["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);  }}

‘’’

 

  1. 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.all[“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.

  1. I wonder what caused the error after the first purchase.
  2. And I'd like to test the first purchase situation again, is there a way to delete the purchase history?

 

  1. 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!

icon

Best answer by jazmine 17 August 2021, 23:51

View original

1 reply

Userlevel 2
Badge +6

Hey @Park :wave: ,

 

I wonder what caused the error after the first purchase.

 

Without any debug logs, I can’t exactly pinpoint what would have caused this error initially. It could have been due to something in the Play Store Sandbox environment. If this occurs again check the debugs and let us know. 

 

And I'd like to test the first purchase situation again, is there a way to delete the purchase history?

 

For testing a new purchase again we recommend creating a new licensed tester.

 

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?

 

We only recommend testing on a IOS simulator starting from IOS 14. Here are some docs from reference here: https://docs.revenuecat.com/docs/apple-app-store#ios-14-only-testing-on-the-simulator. What IOS version are you using on your simulator?

 

Reply