fix(iap): eagerly start IAP service at launch (final review I-1)

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.
This commit is contained in:
2026-06-13 14:29:20 +09:00
parent 640b23804f
commit 7bea9c1456
+4
View File
@@ -19,6 +19,10 @@ class _BlockSeasonsAppState extends ConsumerState<BlockSeasonsApp> {
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);
});
}