I saved a web application to my home screen, but the icon on the home screen opens a different URL. Somehow the URL of the bookmark that was saved to the home screen does not match the URL that was in the address bar.
Steps to reproduce
- On an any iOS device… (I used an iPhone XR)
- Browse to https://bc.thrive.health/covid19app/home
- Press the Share button
- Choose "Add to Home Screen"
- Notice that the URL in the pop-up prompt
https://bc.thrive.health
is different from the URL in the address bar.
What causes this? How does iOS determine what URL will be used when adding to the home screen, and in what circumstances can it be different from the URL in the address bar?
Best Answer
The way that iOS apps save/install to the homescreen is by checking something called the
manifest
. (see more)The URL being referenced in the manifest.json at the specified URL is pointing to "/" meaning the root of the site which means it is working as expected.
There are two options to resolving it
Change the
start_URL
to match your destination i.e. "/covid19app/home" instead of "/"Look into options to creating a relative URL per page based on the header URL if needed for multiple pages.
Your
manifest.json
file is located in the root directory. Alternately you can find resources to creating one for a web app.