From 7bea9c1456621a8b1c2d6952d9b78681e282721f Mon Sep 17 00:00:00 2001 From: airkjw Date: Sat, 13 Jun 2026 14:29:20 +0900 Subject: [PATCH] fix(iap): eagerly start IAP service at launch (final review I-1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit iapServiceProvider was lazy and only read by Settings, so the purchase stream attached only after opening Settings — deferred/interrupted/restored transactions wouldn't be delivered or completed until then. Read it in the post-frame callback so the stream is live for the whole session. --- lib/app.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/app.dart b/lib/app.dart index 10cf9b2..c7dbcf7 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -19,6 +19,10 @@ class _BlockSeasonsAppState extends ConsumerState { super.initState(); WidgetsBinding.instance.addPostFrameCallback((_) { ref.read(consentServiceProvider).ensureConsentAndInitialize(); + // Eagerly start the IAP service so its purchase stream is live for the + // whole session — restores and interrupted/deferred transactions are + // delivered (and completed) even if the player never opens Settings. + ref.read(iapServiceProvider); }); }