How to create admob app-ads.txt file flutter web app? - flutter

I have a website made with flutter web. My app which shows google admob ad. Now google admob told me to create an app-ads.txt file on my website . Flutter web is a single page website so, is it possible to create an app-ads.txt file with my flutter web app !?

I also recently tried flutter web. I went on a "fishing expedition", and managed to solve this issue.
What i did:
Place your app-ads.txt in <project>/web folder.
Run flutter build web
Check that app-ads.txt appeared in build/web folder.
Check that in build/web/flutter_service_worker.js in RESOURCES map appeared a record with key "app-ads.txt"(ex. "app-ads.txt": "4c75380ac52243715a448e96239e0ca5",)
Run firebase deploy --only hosting
After this, app-ads.txt should be available on https://your-domain.web.app/app-ads.txt, https://your-domain.firebaseapp.com/app-ads.txt and(if you added a custom domain) on https://my-custom-domain.com/app-ads.txt.
P.S. If you got redirected from /app-ads.txt to your main page, then try to clear your site cache:
Press F12
Open "Application" tab
Choose "Storage"
Press "Clear site data"
After this, app-ads.txt should be available.

Related

How to install app with full path on Flutter Web?

I have a Flutter Web app, where my customers can create their own pages. So they access their pages like this:
mydomain.com/mycustomerpage/admin
The problem starts when they decide to install the app (PWA) on their desktop. When they open the installed app, it goes to mydomain.com and not the full path stated above.
I tried it myself, and even if I install the web app through a customer admin page, it only keeps the root domain when opened.
Does anyone know how to install the app including the full path?

How to open flutter web app in browser just like a html file

I was trying out flutter web and I wanted to share what I built with my friend so I wanted to know how to make my flutter web app open and run in browser just like html file where you would just click the file and open it with chrome and the site loads up
You cant open a flutter web project directly.
This is because flutter build web, will produce a Single Page App or SPA that will not work unless it's hosted via a server.
The user will either have to run a local server in-order to view the pages and for that you can use python 3's http.serve command or the dart variant dhttpd, the option is you can use a hosting solution like firebase or netlify to host your application if a local server is not possible.

How to export Flutter project for web hosting

I have developed a web app using Flutter in Android Studio IDE, and have enabled Flutter Web from the Flutter console. In Android Studio, I am able to run the app and use Chrome(web) as my target device; and the app runs well.
Can anyone advice what is the next step to export this to a web hosting service? Like PorkBun. Any help is appreciated, thanks!
Run this command in the terminal:
flutter build web
It will compile your project for the web, then you should see a generated files under [your_project]/build/web
Upload the contents of the web folder to the root folder of your hosting service. The main page index.html should run your app.

I want to update the existing logo for my PWA app

When I am updating the logo of the PWA app the icon is not getting updated for the previously installed applications. However for newly installed apps I am getting the correct logo.
Did you try updating the new image icon in manifest.json & then showing a prompt to users to refresh the PWA?
You can try to have a look at the documentation for Android APK (from the question is not clear your target device: web or mobile).
Chrome will periodically compare the locally installed manifest against a copy of the manifest fetched from the network. If any of the properties in the manifest required to add the PWA to the home screen have changed in the network copy, Chrome will request an updated WebAPK, reflecting those new values.
This feature is not yet available for desktop, but planned in a future release.
Do you use any framework (Angular, React) to build your PWA? If you want to read more details about how to install an app on the homescreen or the web manifest properties, you can have a look here.

Ionic workflow questions and facebook authentication issue

I'm trying to implement mobile application using Ionic. I'm following this, but unfortunately logging in doesn't work on real device. It works fine in the browser and the emulator. I did every step from the tutorial, I did the tutorial 2-3 times and still get the same error.
I am logged in successfully on my device but then I see the following screen:
I already have both urls as redirect urls in my application settings in FB.
http://localhost:5000/oauthcallback.html
https://www.facebook.com/connect/login_success.html
I tried to debug OpenFB with alerts. I can see "cordova events" alert but then I have alerts on the first lines of loginWindow_loadStartHandler and loginWindow_exitHandler but they are not executed. I guess that the problem is there but I have no idea how to fix it.
if (runningInCordova) {
alert("cordova events");
loginWindow.addEventListener('loadstart', loginWindow_loadStartHandler);
loginWindow.addEventListener('exit', loginWindow_exitHandler);
}
Also I have some questions about Ionic and Phonegap.
I use Ubuntu and I am trying to build iOS and Android applications.
My application's structure is:
app/
hooks/
platforms/
plugins/
scss/
www/
Also I have InAppBrowser plugin:
cordova plugin add org.apache.cordova.inappbrowser
but this plugin is not part of app/www folder.
I am trying to build a phonegap application in their site. I made a .rar file of the app/www folder content and upload it. Everything seems to be fine. But in Phonegap site when I click PLUGINS, I see This application has no plugins. How should I add inappbrowser to the application, maybe that is the reason why my FB authentication doesn't work. If I build the whole app folder, again I see the same message - This application has no plugins.
So when create an archive file of the content for Phonegap, which folder I should archive - the whole app folder with all subfolders or only app/www? What is the correct flow? Also how crossplatform app should now about added plugins?
I ran into this issue today, if someone is still looking for the solution for this:
loginWindow.addEventListener('loadstart',
loginWindow_loadStartHandler);
is implemented in the js file, but the loadstart event never fires on my Android (but works on WindowsPhone cordova javascript app), instead i added:
loginWindow.addEventListener('loadstop',
loginWindow_loadStartHandler);
,which works on both Android and WP (with InAppBrowser 1.2.0), IOS test is still ahead.