iOS alters the URL given to share extension

I'm building a share extension for my app when I noticed something weird.

When I open a mobile URL (URLs with "m." like m.randomsite.org) on iOS using a browser (I'm using Safari & Chrome) and then try to share it, what will be share is the URL without the "m." (i.e. randomsite.org)

This messes up with my app since I'm not getting the real URL that I'm viewing using the browser.

I don't think it has something to do with my app since even selecting "Copy" when sharing will result in the altered URL too.

So far this is happening on both iOS 17 and 18. Does someone know whether this is a bug from iOS or not? I don't think this is a Safari bug since I noticed the same thing on Chrome as well

When you share to your app, if the site is delivering a mobile site to your phone, once shared to your app does the site not redirect to the mobile site again?

I would consider dropping the m. as possibly a bug but most sites have logic in place to render the correct site based on user agent or other means.

Rico

WWDR - DTS - Software Engineer

iOS alters the URL given to share extension
 
 
Q