Android Firebase not working for flutter web - android

I have been working on my app I added a firebase Android backend tho I need the app to work on both Android and web, When running the app on an android emulator everythin works just fine but When I run it on a web (Google Chrome) the code excutes without giving any errors but the chrome window is empty and dont have anything on it.
The UI worked just fine on both web and android before adding firebase and yes I have added a web app on firestore.
thanks for the help

Related

How can I run ionic-angular application that calls APIs as Android App on a device

I have built an ionic angular application that connects to an API end point. On the web browser it works well. I compiled it for Android platform and opened it on the Android studio. When I connect my phone to the PC and run the application, it opens the login page which by default loads when the application starts up. However, immediately upon starting up it is supposed to make an API call which loads the initialization data, it instead generates a message as shown in the image attached.
error from API call in ionic-angular app on android
I have tried to find out, but it seems that the API calls are being blocked as the initialization data is not retrieved from the remote server. I checked through and found some related problems but their solutions never worked for me. Some of the links I referred to are:
XMLHttpRequest failed on App
https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-whitelist/
https://stackoverflow.com/questions/54275697/ionic-4-app-not-working-in-android-device#:~:text=2%20Answers&text=Go%20to%20AVD%20manager%20in,android%20and%20it%20should%20work.&text=When%20I%20had%20this%20issue,use%20the%20'new'%20operator.
Could someone point me to some info that can help me fix this issue.
I am relatively new in Angular and Ionic programming and I don't have a experience in using raw JavaScript though I use TypeScript in Angular framework.
I was able to fix my issue with the help from the link
https://imstudio.medium.com/android-8-cleartext-http-traffic-not-permitted-73c1c9e3b803

"Google Maps JavaScript API error: RefererNotAllowedMapError " error from trying to use api from within React Cordova iOS, but works fine in Android

I have in my index.html for my WebApp and Cordova App:
And the code works perfectly to load the google api, in my webapp, and Cordova for iOS and Android apps.
For the webapp I loaded the various URLs that I wanted to authorize:
http://wevote.us/*
https://wevote.us/*
http://localhost:3000/*
https://localhost:3000/*
All worked perfectly for the webapp.
Then I ran the same code in Android (within Cordova). A console error said to add "file_url//android_asset/www/index.html#/ballot" on the Google Cloud Console, which I did, and 5 minutes later my hybrid Android app was working perfectly.
__file_url__//android_asset/www/index.html#/ballot
But with iOS, the similar console error says
2018-05-23 13:59:22.344204-0700 WeVoteCordova[52841:2772856] ERROR: Google Maps JavaScript API error: RefererNotAllowedMapError https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error Your site URL to be authorized: __file_url__//Users/stevepodell/Library/Developer/CoreSimulator/Devices/D476226046...99AEE3DC/data/Containers/Bundle/Application/7A844..10D/WeVoteCordova.app/www/index.html#/ballot
Clearly any URL that contains paths on my Mac is not going to work, but as an experiment, I simply added that suggested url (knowing it would only work for one build, on one simulator) and the Google Cloud Server API key page crashed on save, and did not retain the data.
Has anyone gotten this to work on iOS?
There is a google bug https://issuetracker.google.com/issues/35828931 but it is closed, and it looks like it is not being seen.
Updated May 24, 2018:
There now is an open google bug https://issuetracker.google.com/issues/80230742

reCaptcha v2 & Invisible Captcha on Cordova-based apps

Has anyone ever tried to integrate reCaptcha v2 or the invisible captcha on a Cordova-based app?
I have configured everything correctly. Once I launch my page as a Web Site, everything works great and I see the reCaptcha v2 working. However, when I run the page as an app on Android or iOS I see the error which says:
ERROR for site owner:
Invalid domain for site key
I've also unchecked the option in Google Console to prevent the domain check, but it only affected the web site and not the app.
Does anyone have any experience integrating reCaptcha v2 or invisilbe Captcha in a cordova-based app?
After deep investigation seems that the issue is related to the fact that the Cordova-based apps run over the file:/// protocol which seems to cause the issue.
Actually we've faced the issue only on Android devices, ios devices seem to work fine.
We've finally fixed the issue creating a web page on our web site and putting there the invisible recaptcha library then we've linked the page inside an iFrame in the app.
This tricks let us to run the recaptcha library over the http protocol which has fixed the issue.
Try to install cordova-plugin-ionic-webview#latest using the below command
cordova plugin add cordova-plugin-ionic-webview#latest

Cordova Url Loading Not Working

I am coding a Cordova application in Visual Studio. It is a hosted web app which means Cordova starts a webview with the local index.html and after deviceready, I redirect the document location to my locally hosted web url.
When I was testing on iPhone (iOS 9.3), I noticed that the Cordova app hangs/freezes at the splash screen after I rebuild the hosted web page. I thought it might be due to the latency occurring after compilation because it works in the successive trials. And I tried to debug using Visual Studio, attaching to the local device, and using the console I changed the url to test several sites. When response is immediate, no problem but when there is even about a second of latency, it does not navigate, but there seems no error in the Javascript Console of the Visual Studio debugger.
I know that there is a "loadUrlTimeout" parameter in the config.xml for Android but there is none for iOS. (I did not try it with Android if there is such a problem there too.) Am I doing something wrong? Is this the expected behavior? How can I fix it?

Load webside in iOS App and Android App, not loading after changes

I have a page that is opened inside a webview (Android) and uiwebview(iOS). When it is in the app, it works perfectly, but when I made a change in the code in the hosting site, the page wont't load in Android or iOS either. It's telling me that "error resource is not available". The page does load after refreshing many times. I don't know what is happening. The page is built in Laravel 5.1 and my hosting site is GoDaddy.
Does anyone has the same problem?
Is the app hosted on godaddy using javascript files? In that case you might want to handle that in android app.
For starters you can try to access the website in chrome/ any browser on android device, if its working, try and delete data/cache of app from settings. Or simply just uninstall and install again.

Categories

Resources