Purchases work fine, but I realised my users take no further steps as expected. So I debugged with a Appstoreconnect Sandbox user and real iPhone device.
After the purchase in PaywallFooterView(), log shows both debugPrints from onPurchaseCompleted, but navigation inbetween gets ignored. A bit strange since not async. Navigation in onDismissed gets executed.
I can probably workaround by settings flags in onPurchaseCompleted, and navigate to another page in onDismissed, but I think this is unexpected behaviour?
Log:
flutter: 🟩 onPurchaseCompleted msg
gpaywalls] DEBUG: Looking up localization but found no strings
flutter: 🟩 onPurchaseCompleted - Transaction: xyz
flutter: 🟩 onDismiss
flutter: Page2 opened
Code in PaywallFooterView():
onPurchaseCompleted: (CustomerInfo customerInfo, StoreTransaction transaction) {
debugPrint('🟩 onPurchaseCompleted msg);
Navigator.of(context).push(MaterialPageRoute(builder: (context) => Page1()));
debugPrint('🟩 onPurchaseCompleted - Transaction: ${transaction.transactionIdentifier}');
},
onDismiss: () {
debugPrint('🟩 onDismiss');
Navigator.of(context).push(MaterialPageRoute(builder: (context) => Page2()));