I’m looking for a solution to the following. We’re looking to send a html mailer out next week and currently having some issues. This is the first one we’ve tried to do like this, and the main difference is that it now contains buttons which to our .

The mailer is responsive and so we are looking for a solution which will the desktop version of the site in browser, and when viewing from a , check if the is installed and open it, and if not open the link in the browser instead.

Through extensive search online and Stack Overflow I’ve come to realise that there is a difference between how and iOS allow this. See below the solutions I have tried so far:

.mobile-link {;
   : none;
}

@media screen and (max-device-width: 767px) and (orientation: portrait) {
    .desktop-link {
        : none;
    }
    .mobile-link {
        : block;
    }
}

@media screen and (max-device-width: 1024px) and (orientation: landscape) {
    .desktop-link {
        : none;
    }
    .mobile-link {
        : block;
    }
}
<a class='mobile-link' onclick='
setTimeout(function () { window.location = 'www.facebook.com/profileid'; }, 2500);
window.location = 'fb://facewebmodal/=pagename';'>
    <img src="http://stackoverflow.com/some.url" />
 </a>
 <a class='desktop-link' href='www.facebook.com/profileid'>
    <img src="http://stackoverflow.com/some.url" />
 </a>

This is not working on iPhone although my previous attempt was (I changed it to make it work for Android, which still doesn’t work). In my previous attempt I had :

<a class='mobile-link' onclick='
    setTimeout(function () { window.location = 'www.facebook.com/profileid'; }, 2500);
    window.location = 'fb://profile/id';'>
        <img src="http://stackoverflow.com/some.url" />
     </a>

Which worked for iOS but not for Android.

From what I understand facebook seems to change how users can target the app in this manner regularly.

Can anyone provide me with the most recent way to target both the iOS and Android app in a link of this kind please?



Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here