Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.24.3, on Microsoft Windows [Version 10.0.22631.4317], locale ja-JP)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.11.5)
[!] Android Studio (not installed)
[√] IntelliJ IDEA Ultimate Edition (version 2024.2)
[√] VS Code (version 1.94.2)
[√] Connected device (3 available)
[√] Network resources
! Doctor found issues in 2 categories.
[x] Version of purchases-flutter
8.1.6
[x] Testing device version e.g.: iOS 15.5, Android API 30, etc.
Android API 34
[x] How often the issue occurs- every one of your customers is impacted? Only in dev?
I/[Purchases] - INFO(31871): Purchases instance already set with the same configuration. Ignoring duplicate call.
I/[Purchases] - INFO(31871): 😻💰 Purchase history retrieved skus: [xxxx], purchaseTime: 1729920583381, purchaseToken: xxxxxxxx
[x] Steps to reproduce, with a description of expected vs. actual behavior
Place print('Some message.'); in the callback function of addCustomerInfoUpdateListener().
Run the app.
Check that the message is printed in the console.
Hot restart the app.
Check that the message is not printed.
Expected behaviour: The message is printed.
Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)
Describe the bug
The callback function of addCustomerInfoUpdateListener() used to be called both on app start and on hot restart. I have confirmed it with purchases_flutter 8.1.0. I upgraded the package to 8.1.6 today and found it is no longer called on hot restart.
Additional context
It is really inconvenient that I need to kill and rerun an app to avoid the issue in debugging.
It looks like the callback function is not called when restorePurchases() is executed after a hot restart either.
Environment
[x] Output of
flutter doctor
purchases-flutter
print('Some message.');
in the callback function ofaddCustomerInfoUpdateListener()
.Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)
Describe the bug
The callback function of
addCustomerInfoUpdateListener()
used to be called both on app start and on hot restart. I have confirmed it with purchases_flutter 8.1.0. I upgraded the package to 8.1.6 today and found it is no longer called on hot restart.Additional context
It is really inconvenient that I need to kill and rerun an app to avoid the issue in debugging.
It looks like the callback function is not called when
restorePurchases()
is executed after a hot restart either.