-
Notifications
You must be signed in to change notification settings - Fork 4k
🐛 [firebase_messaging] The problem that initState () is called even if the app is terminated #6517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@jinnyum When app is terminated using swipe and a push notification is received, you'll need to manually open the app so that the background message to work and act upon received push. https://firebase.flutter.dev/docs/messaging/usage/#receiving-messages Does this info help to answer your question ? |
My question is that even if the app is closed, the app will be executed internally if the push is received. |
Hi @jinnyum |
I'm not talking about onBackgroundMessage . |
Can you provide a minimal complete reproducible code sample? |
Token registration sites must be set to their own.
|
How exactly are you checking that |
If you call http as in the code below, the server will check it.
|
If that is the case you should be able to narrow the example down to just printing instead of using these third-party package methods and it should still reproduce? |
This situation occurs after the app is completely terminated.
(It will be reproduced even if you check with the above code..) |
Not sure what you mean by "official manual also sends tokens to the server". You should be able to just put print("initState"); into |
It is reproduced with the code below.
|
Seems reproducible with flutter doctor -v
|
Sorry but I'm not sure what the answer means.
|
No, I'm saying the issue is reproducible and warrants some investigation. |
The app is being processed as a start, even though the user did not start. |
Can anyone please give me an answer on how this issue is being resolved... T_T |
Do we have any update on the status of this issue? Do we have any workaround for the time being? This issue is preventing us to put |
@jinnyum @AyonAB |
@darshankawar Yes I have tested against the most recent version also which is 13.0.0. The issue is still there. |
This bug is related to developer spending. |
Hi, I've confirmed this as an issue. It is basically calling the |
Bug report
Describe the bug
I quit the app by swiping on iOS,
Why is initstate called when a push is received in this state?
Steps to reproduce
Steps to reproduce the behavior:
Expected behavior
I thought the app would do nothing.
Sample project
Providing a minimal example project which demonstrates the bug in isolation from your main App greatly enhances the chance of a timely fix.
Please link to the public repository URL.
Additional context
I did not see an explanation that initState would be called even though the app was terminated.
Is this a bug?
Or is it normal?
Flutter doctor
Run
flutter doctor
and paste the output below:Click To Expand
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.1, on Microsoft Windows [Version 10.0.19042.1052], locale ko-KR)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] VS Code (version 1.57.1)
[√] Connected device (3 available)
• No issues found!
Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below:Click To Expand
Dart SDK 2.13.1
Flutter SDK 2.2.1
ordermgn 1.0.0+3
dependencies:
dev dependencies:
transitive dependencies:
The text was updated successfully, but these errors were encountered: