pwa-builder / PWABuilder

The simplest way to create progressive web apps across platforms and devices. Start here. This repo is home to several projects in the PWABuilder family of tools.
https://docs.pwabuilder.com
Other
2.79k stars 287 forks source link

[DOCS] Clarify that assetlinks.json must be at root of domain. #4426

Closed Eddie-Hartman closed 1 year ago

Eddie-Hartman commented 1 year ago

What's your suggestion for improvement for our docs?

2695 should not have been closed imo without updating the docs to reflect that the assetlinks.json file MUST be at the root of the domain to work properly.

I fell into the same trap and spent a lot of time trying to figure out why I couldn't get the browser bar to go away because of this section:

Once you have an assetlinks.json file deployed to your server, make sure itโ€™s accessible via a web browser at https://\/.well-known/assetlinks.json. (Replace \)

In my case, the url was domain.com/APP, so I put it in domain.com/APP/.well-known/assetlinks.json.

Long story short, it must actually go in your root domain, and not just where the app is. So copying the file to domain.com/.well-known/assetlinks.json fixed the issue for me.

Do you have an implementation or a solution in mind?

Specify that the file must be at the root level of the domain. If your PWA is hosted in a directory such as domain.com/APP, the file still needs to have the path of domain.com/.well-known/assetlinks.json instead of domain.com/APP/.well-known/assetlinks.json.

Have you considered any alternatives?

No response

microsoft-github-policy-service[bot] commented 1 year ago

This issue has been marked as "needs attention ๐Ÿ‘‹" since it has not been triaged for 7 days. Please triage the issue .

microsoft-github-policy-service[bot] commented 1 year ago

This issue has been marked as "needs attention ๐Ÿ‘‹" since it has not been triaged for 7 days. Please triage the issue .

microsoft-github-policy-service[bot] commented 1 year ago

This issue has been marked as "needs attention ๐Ÿ‘‹" since it has not been triaged for 7 days. Please triage the issue .

zateutsch commented 1 year ago

@Eddie-Hartman Just changed the wording with this pull. Does that seem more reflective to you?

Eddie-Hartman commented 1 year ago

Beautiful. Hopefully that saves others some time in the future. Thanks.

vitalii-work commented 1 day ago

@jgw96 Please, mention in asset-links-faq.md the following:

Once you have an assetlinks.json file deployed to your server, make sure the following:

  1. It's accessible via a web browser. Navigate to https://<YOUR-PWA-URL>/.well-known/assetlinks.json. (Replace <YOUR-PWA-URL>) to check whether you see the content of the file.

  2. It is served with content-type application/json.

  3. Status code is 200 (without any redirects, e.g. 301, 302). Some managed VPS hosting providers instruct their web server to block access to .json files. If this is the case, you need to whitelist access to this file.

See other official recommendations from the Google team here: https://developer.android.com/training/app-links/verify-android-applinks#publish-json

Additionally, you can use the following URL to verify a connection to your assetlinks.json: https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://your-domain-name&relation=delegate_permission/common.handle_all_urls (Replace your-domain-name with your domain name)