Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to open the native mobile app? #6

Open
danielt69 opened this issue Apr 11, 2016 · 2 comments
Open

How to open the native mobile app? #6

danielt69 opened this issue Apr 11, 2016 · 2 comments

Comments

@danielt69
Copy link

Hi Stefan,

This is a great tool! but one thing is missing in it....

When I share on a mobile device: instead of opening throw the "URL schemes" (the native app that installed) it opens a web browser ...

For instance, it opens :
https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fsimplesharingbuttons.com%2F

instead of:
fb://...........?u=http%3A%2F%2Fsimplesharingbuttons.com%2F

Is there a solution for that?

@stefanbohacek
Copy link
Owner

@danielt69
Copy link
Author

danielt69 commented Aug 14, 2016

Hey @fourtonfish,
I found a little workaround for this problem if you want to implement it in your generator:

<a class='btn btn-default' href="https://www.facebook.com/sharer/sharer.php?u=http://www.freebets.co.uk" data-mobilesrc='fb://page/604525276265121'>Smart link</a>

<script>
    $(document).ready(function(){
        $('a.btn').click(function(e){
            e.preventDefault();
            var link = $(e.target).attr('href');
            window.setTimeout(function(){
                window.open(link, "_blank", "toolbar=yes,scrollbars=yes,resizable=yes,top=80,left=15,width=555,height=565");
            }, 50);
            window.location.href = $(e.target).data().mobilesrc;
        })
    })
</script>

You can see here all the links for mobile apps: http://wiki.akosma.com/IPhone_URL_Schemes#Facebook

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants