4

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?

2
  • 1
    apple.stackexchange.com/questions/347259/…
    – anki
    Commented Apr 8, 2020 at 15:52
  • @ankii Yes, it looks like my question is a duplicate of that one. But I can't close this question while it has an open bounty. Also the link doesn't quite answer my case because I'm not using <link rel="canonical">
    – Nic
    Commented Apr 8, 2020 at 18:26

2 Answers 2

1
+50

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.

1

If you’re asking from an end user perspective, a workaround is turning on Airplane Mode. That will allow you to then browse to the site, it won’t load, but adding to home screen will be the address you entered.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .