swift – Adding a custom-designed icon for a third-party app to the iOS homescreen without shortcuts app


I’ve been working on a theme app that allows users to add custom designed app icons to their homescreen.

I want it to work like this:

  1. The user taps for installing an icon and I open a webpage in safari.
  2. From this webpage the user taps on the share button and taps on add to homescreen.
  3. The custom icon is installed on the homescreen and when this icon is clicked, it opens it’s respective app.

This app makes it work the same way I want it to: https://apps.apple.com/us/app/themely-homescreen-layout-icon/id1569379140

I would appreciate your help in finding a solution.

I have figured out how to pass the custom icon to safari for adding to homescreen

<link rel="apple-touch-icon image_src" href="apple-touch-icon.png">
but Safari only sets the webpage URL as the icon’s target. I need to set an app url as the icon’s target.