0

So I have published my website online and I tested it on my iPhone and it worked. Now when I link my facebook and linkedin page, it just opens it up in a new tab depending on what browser you are on because I am using target="_blank".

What method should I use if you click on my facebook icon, it can then open to your smartphone's app if you have it installed. Is there a way to just add in a second alternative within my a href tag after my target="_blank"?

Here is what my link looks like currently.

<a href="#" target="_blank"><i id="social-fb" class="fa fa-facebook-square fa-3x social"></i></a>

Note: I replaced my link to my facebook page # for safety purposes.

Azazel
  • 573
  • 3
  • 10
  • 23

1 Answers1

0

Based on Correct way in 2018 to open Facebook app via website link? it is said to use this as your link: fb://profile/PAGEID

So your code becomes:

<a href="fb://profile/#"><i id="social-fb" class="fa fa-facebook-square fa-3x social"></i></a>

And for Android:

<a href="fb://page/#"><i id="social-fb" class="fa fa-facebook-square fa-3x social"></i></a>

You could probably use some fancy javascript to determine user client and redirect accordingly.

Riz-waan
  • 603
  • 3
  • 13