I believe I have followed the documentation correctly, but I must have missed something since restore is not working. Purchase works fine in my testing, thus far all on simulator, iOS and Android.
On my first page I do the following:
@override
void initState() {
super.initState();
SettingsRepository().addLaunchCount();
WidgetsBinding.instance.addObserver(this);
handlePaywall();
}
void handlePaywall() async {
presentPaywallIfNeeded().then((result) {
print('Paywall result: $result');
if (mounted) {
if (result == PaywallResult.notPresented && kDebugMode) {
Purchases.getCustomerInfo().then((customerInfo) {
if (mounted) {
setState(() {
_debugCustomerInfo = customerInfo;
_paywallResult = result;
});
}
});
} else {
setState(() {
_paywallResult = result;
});
}
}
});
}
Then in the page I handle the result. When a user clicks restore all that happens is the button flashes. If I then “close” the paywall with the “x” I get my “successfully restored” response. The “purchase” options work as expected as they go through the store purchase flow then end up dismissing the dialog and my “success” message is shown. What am I missing in this flow? Did I setup something wrong in the paywall or am I missing some check someplace?
