IOS – “Add to Home Screen” saves wrong URL

bookmarksiosmobile-safari

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

  1. On an any iOS device… (I used an iPhone XR)
  2. Browse to https://bc.thrive.health/covid19app/home
  3. Press the Share button
  4. Choose "Add to Home Screen"
  5. 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. enter image description here

There are two options to resolving it

  1. Change the start_URL to match your destination i.e. "/covid19app/home" instead of "/"

  2. 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.