Reputation: 79
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 !?
Upvotes: 3
Views: 1542
Reputation: 434
I also recently tried flutter web. I went on a "fishing expedition", and managed to solve this issue.
What i did:
app-ads.txt
in <project>/web
folder.flutter build web
app-ads.txt
appeared in build/web
folder.build/web/flutter_service_worker.js
in RESOURCES
map appeared a record with key "app-ads.txt"
(ex. "app-ads.txt": "4c75380ac52243715a448e96239e0ca5",
)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:
After this, app-ads.txt
should be available.
Upvotes: 5