0

I have a page that only users of my native iOS app will find, which should open the app. This works (on any other HTML page anyway) by linking to "myapp://path/inside/app".

Wordpress keeps "fixing" this to "https://path/inside/app", which doesn't work of course. I didn't find a setting to stop it from doing this. Is this possible?

3
  • 1
    Where are you adding this link from? From the editor, the menu configuration page? My suggestion for this would be to use JavaScript to dynamically change the href of the link when somebody clicks it. Nov 25, 2020 at 16:47
  • Adding the link from the editor.
    – Stefan
    Nov 25, 2020 at 20:48
  • Basically, I need something like this: sevenspark.com/tutorials/skype-uri-link-wordpress-menu but not for the skype:// protocol. Isn't editing the themes functions.php the wrong approach here as it gets overwritten on update?
    – Stefan
    Nov 27, 2020 at 7:38

2 Answers 2

0

I think your problem is that an HTML page is a single point of reference. Swift allows you to define that custom URL in your app ( https://www.hackingwithswift.com/example-code/system/how-to-make-your-app-open-with-a-custom-url-scheme) but WordPress rewrites itself and all sub-pages, api etc. to the URL defined in the database options. So, short answer, you can't do that. If you were to set the URL of the WordPress site to myapp://whatever.com it would break. Do you have to use myapp:// ?

1
  • If I would be able to add a link to myapp://whatever nothing would break. A user without my app installed would just land on an unloadable page outside of my wordpress site.
    – Stefan
    Nov 25, 2020 at 20:50
0

I created this plugin to address my problem: https://github.com/mehlkelm/Allow-My-URL-Schemes At the moment it only works for my apps, pull requests welcome!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.