FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
127 stars 26 forks source link

The native app doesn't launch without Internet connection #2950

Closed oper2k closed 1 month ago

oper2k commented 5 months ago

Has your issue been reported?

Current Behavior

I created a mobile app, but it doesn't launch without an internet connection. It just gets stuck on the loading screen (white screen on iOS and logo screen on Android). I mean the mobile apps that I created using FlutterFlow.

Expected Behavior

The mobile app launches on the Home or Welcome screen.

Steps to Reproduce

It’s difficult to reproduce this error; it’s possible that some widget or package doesn’t work without an internet connection. I have several such projects, and some of them launch without an internet connection.

Reproducible from Blank

Bug Report Code (Required)

ITFfl+fq2ItOsbQC7q6JbsFv+SkQHHkcTIMziNZ+exUbfaL1BqQqdc78XFVvXcOhaVNcD0yKgkQJzN7QufHXC/EnPgqdfYhl/6hiTgz0e2i6b7GVELmOWGtPBexjC1S73KWC3R1TCNNZW1o/3zqDeu6iShLDFOu/Zwh9f6PHaOI=

Context

This started happening in one of the projects a month ago. Now, more and more projects are behaving this way and don't launch without an internet connection.

Visual documentation

unnamed

Additional Info

I mean the mobile apps that I created using FlutterFlow.

Environment

- FlutterFlow version: 4.1.53
- Platform: iOS, Android
- Browser name and version: Safari
- Operating system and version affected: macOS 14.5

General

Relative to the time the changes were made, data was lost within

When following my steps to reproduce, data loss happens

oper2k commented 5 months ago

I investigate the problem If I enable remote config my app doesn't works without the Internet. Pls fix it)

paulperez-dev commented 5 months ago

Hi @oper2k! I was able to run the app on my Android device without an internet connection. An image did not load (as expected), but the app started.

Can you please verify if the issue persists? Notice that the version we use to verify this issue is the one created at the moment of the bug report code generation. Any further change is not included. So, if you changed some configurations after reporting the issue, please attach a new bug report code where the issue is present, thanks!

oper2k commented 5 months ago

Hi @oper2k! I was able to run the app on my Android device without an internet connection. An image did not load (as expected), but the app started.

Can you please verify if the issue persists? Notice that the version we use to verify this issue is the one created at the moment of the bug report code generation. Any further change is not included. So, if you changed some configurations after reporting the issue, please attach a new bug report code where the issue is present, thanks!

Did you enable remote config and create a some Parameter?

paulperez-dev commented 5 months ago

Hi @oper2k! I run your app, with all the configuration you have there.

oper2k commented 5 months ago

Hi @oper2k! I run your app, with all the configuration you have there.

I've deleted "remote config" from my app, because the app doesn't work with it)

You can create new app, enable remote config, create any parameter and aft that try to run app without the Internet connection

paulperez-dev commented 5 months ago

@oper2k Given the nature of the problem you're highlighting, we need a blank project with the issue steps set up in it. Without these details, it might be a bit challenging for us to investigate the issue. Please share the bug report code of the new project.

oper2k commented 5 months ago

@oper2k Given the nature of the problem you're highlighting, we need a blank project with the issue steps set up in it. Without these details, it might be a bit challenging for us to investigate the issue. Please share the bug report code of the new project.

You can try to run this project without the Internet connection- IT4slfLl/ZNgrsNa1bqBb8FB/GUWQm4ha5IKsctFb0ggGJTsBqQMP/TsTE5DTsvmaVNcI1eInnoH3NL3hvP+Ffk5F0itY606/5BhWw/Oe2i6b7GVELmOWGtPBexjC1S73KWC3R1TCNNZW1o/3zqDeu6iShLDFOu/Zwh9f6PHaOI=

oper2k commented 5 months ago
Снимок экрана 2024-05-28 в 17 33 00
github-actions[bot] commented 5 months ago

This issue is stale because it has been open for 7 days with no activity. If there are no further updates, a team member will close the issue.

paulperez-dev commented 5 months ago

Hi @oper2k! Sorry for the late response. The latest shared project have some configuration issues:

image.png

So, no way to test it. Also, it would be better if you can share a bug report code from a blank project, so we can triage the issue faster, thanks!

oper2k commented 5 months ago

Hi I created a new project for you but I can't to copy bug report code I got the error

Снимок экрана 2024-06-07 в 11 01 54

This is the link to my project https://app.flutterflow.io/project/test-remote-config-mnweij?tab=widgetTree&page=HomePage

You need to turn off the internet connection on mobile phone before fist run and you'll get error

Снимок экрана 2024-06-07 в 10 58 53

If you turned on the Internet connection the mobile app launch normally

It's working only first time launch. If you launch the application for the first time with the internet enabled, it will start normally and will continue to work without the internet. You will need to delete it and launch it again.

Steps for reproducing:

  1. Download the code
  2. Open project in VS code
  3. Open any android simulator
  4. Turn off internet connection on simulator
  5. Try to first launch app
azizirac commented 5 months ago

Confirm, I have the same problem. I spent all the day trying to figure out what was the issue.

The app was working fine, the day before, and the in the morning wasn't working. I spend the entire day debugging and rolling back changes. Only after realising the phone had wifi disconnected and enabling it, then it worked.

The logs were mentioning issues about Remote config. It was wired because IOS, web test, emulators were all working. The issue was only in my android device (Pixel 8a) which wasn't connected to internet. So I think the exception was't catch properly in the code.

To double check, I put my iPhone in plane mode, and I had same issue there too.

paulperez-dev commented 5 months ago

Hi @oper2k, @azizirac. This is the expected behavior of the package (it also happens inf Flutter). The first time the app lunches it needs to look for the remote configuration, but if there is no internet connection, it fails. When trying to get the remote value after the first successful launch and there is no internet, the package get the value from cache.

I'm closing this issue since this is not a bug.

azizirac commented 5 months ago

@paulperez-dev, I understand that Flutter has this behaviour so you are not considering as a bug. However we am using FlutterFlow to configure the remote config, and I think everyone would benefit from a grace failure instead of a blank page. I even have default value on my remote config, which I thought they are used as a fall back in case of missing connection, but looks like they are not.

If you are not considering it as a bug, can you keep open this issue as feature request? Good apps don't freeze in the launch page. User will have no idea what's going on. At least a pop-up or info banner alerting users that the app needs internet. Is there a way to achieve it?

ready4sea commented 2 months ago

@paulperez-dev, having encountered the same issue as the other users, I finally found this closed bug report.

While I understand that the Flutter package also "fails" in such conditions, I believe what @azizirac was saying is that the FlutterFlow use of the package could be corrected.

Indeed, at present, when launching the app while offline, the app attempts to fetchAndActivate(). And, as mentioned, this will fail. Fine. But the real issue is that the exception in not caught by the FlutterFlow implementation. As a result the app freezes on launch. On the other hand, with a try catch block, the app will then run as intended, as such : image

I'm sure the Flutter package intends the fetchAndActivate() call to be wrapped in a try catch block. It is the case in the example provided in this reply : https://github.com/firebase/flutterfire/issues/8658#issuecomment-1215061048. And it is also the case in that discussed here : https://akanksha98.medium.com/utilizing-firebase-remote-configs-within-flutter-integration-tests-4da66be4281e

In short, @leighajarett, could you please reconsider in order to make Firebase Remote Config work for your users ?

azizirac commented 2 months ago

@ready4sea, thanks for your input. That's exactly my point. The app should not freeze in these cases. I would love to communicate to customer that the app requires internet to function, but at the moment the app just freezes at the launch, leaving the user with a bad experience since has no idea why the app is not working,.

@paulperez-dev, these are some suggestions:

  1. swallow the failure with a try catch, and let developer decide what to do when the config are missing using default values.
  2. catch the exception and show popup message to customer about Internet issues.
ready4sea commented 2 months ago

Any news regarding this ticket ?

leighajarett commented 1 month ago

Thanks for following up - I will reopen and we will try and implement your proposed solution!

ready4sea commented 1 month ago

Yay ! 🙌 Looking forward to testing this one.

leighajarett commented 1 month ago

Yeah we just implemented your suggestion! Its still going through beta testing but should be in the product in the next week or two!

ready4sea commented 1 month ago

Yeah we just implemented your suggestion! Its still going through beta testing but should be in the product in the next week or two!

Sounds great !

azizirac commented 1 month ago

@leighajarett thank you so much!! Can’t wait to test it out:)