I've been using flutter run -d chrome to start a web version of my app. The app uses FirebaseAuth and when I try to login using Google it tells me it's not secure. I think because the run command is setting up the server for http requests instead of https. If I try just changing the url to https I get an error.
I've looked all over and cannot find any options to tell flutter to use https. Anyone know how to do this?
You can build it and serve it via a webserver. You need a certificate that chrome tells you that the website is secured.
Related
I just started-off with flutter web and I want to use brave browser to debug my flutter apps not chrome or edge.
When I use flutter devices command, it gives the following result.
No devices detected.
Run "flutter emulators" to list and start any available device emulators.
I'm using brave by using the link provided by web-server and it does not support hot reload.
So, how to configure browsers other than chrome or edge with flutter web for complete functionality.
I found this:
All you have to do, based on your Linux operating system (for Windows
and macOS the process is similar), is to modify your .bashrc file and
insert this line:
#Put your Brave installation location here
export CHROME_EXECUTABLE="/opt/brave.com/brave/brave-browser"
For MacOs,
export CHROME_EXECUTABLE="/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"
You can use flutter run -d web-server to run your app like a server.
This means that you can just enter the URL on any browser of your choice to access your Flutter app !
Drawbacks:
Hot Restart/Reload from the terminal is not possible. You must refresh the page on your browser instead.
Advantages:
You can use any browser for developing flutter apps.
You can even use ngrok to forward your port to a HTTPS URL, and access your flutter app from anywhere (your phone, your desktop , someone else's device etc.)
PS: Credits to the Issue #77229 for helping me find this solution. I am aware that this workaround has already been suggested on this thread.
I just wanted to put out a simpler answer for the general viewer.
I've been diving in the same issue, it's known Brave it's Chromium-based, this will help u https://github.com/flutter/flutter/issues/77229
I built flutter application for web. And able to launch the app using the below command.
flutter run -d chrome
But the above command launches my web app in chrome with http://localhost:59111.
I need to test web application in https:// not with http://
Can anyone suggest me to launch web app with https:// localhost.
You can use mkcert to mock a trusted certificate while testing locally using localhost. mkcert automatically creates and installs a local Certificate Authority (CA), and generates locally-trusted certificates.
I am struggling to make HTTP native or HttpClient get to work for my app.
If I run ionic serve -c I get HttpClient working good on my browser at localhost:8100 and in Ionic Dev App. If I build for Android though, HttpClient fails thus I decided to give HTTP Native a try.
Then I don't understand how I could get some console log if that native plugin is not supported from Ionic Dev App (here says), neither I can see on my browser cause of Cordova is not present.
Is there a way to log on a device to debug HTTP Native?
You should debug your application connect your phone to your laptop and
Open your Google Chrome Browser
Go to Inspect (Ctrl + Shift +I)
Go To More Tools enter image description here
Open Remote devices and inspect your device
For more information click here
Thanks
You wont see native http calls log to the browser since they are called native from the device and never are called from the browser, but if you are debugging while connected to xcode, the xcode debugging output should give some information about your native HTTP calls success and failure.
Following #vd_virani answer, here is a quick link to inspect a device from Chrome
chrome://inspect/#devices
Plug your device via USB, then copy & paste this link in your Chrome address bar like a website.
After generating Android build and inspect within Google chrome.
The url in app should be file:///android_asset/www/index.html (Image2)
But always getting localhost.
Why its showing localhost:8080 …?? (image1)
The url in app should be file:///android_asset/www/index.html
But its running in localhost://8080
yes, Ionic always getting node(npm) as a localhost server
I just created a draft app using ionic and wanted to see it on the browser using
ionic serve
but ran into an issue:
it kept failing to open the browser and I had to open Firefox manually. so I was curious if there is a way around this? managing permissions and stuff.. or I have to live with it!
Thanks for your insights
ionic serve don't know which browser to run, so, add a default browser.
ionic serve -f firefox