简体   繁体   中英

Facebook Share From Mobile Web to Native App Without Javascript?

I am looking to let a reader of my site share the url from a mobile browser to their native facebook app without using javascript, or having them login through the cumbersome web process.

In the past, this was accomplished using the fb://publish/profile/me?text=blah url scheme for both iOS and Android. When clicked, this link would open the native app and start a new share dialog.

Sometime in late 2013/early 2014 though, this method stopped working. Is there a more current way to use a static URL to open up a native share dialog on iOS and/or an Android Intent? A canonical answer is needed here as searching SO leads to a ton of old, deprecated dead ends.

It's crazy that facebook doesn't have the latest URI schemes documented. Whatsapp, twitter, mail, sms, tel all have them available and are working.

Whatsapp:

whatsapp://send?text=Hello%20World!

Twitter:

twitter://post?message=hello%20world!

Mail:

mailto:<address>[?<header1>=<value1>[&<header2>=<value2>]]

SMS:

sms:+15105550101?body=hello%20there

Tel:

tel:<phonenumber>

I've been researching methods of HTML5 interaction with phone features (intents), maybe there is a way to open the mobile phone share menu from a web url? This would allow the user to share an article, per say, with any native app if installed (fb, twitter, etc...)

我不知道你是否遇到过这个帖子,但这个家伙似乎做了一些逆向工程,并且列出了所有Facebook自定义URL方案的完整列表

In short there is NO official or unofficial way to do this anymore (or yet).

The URL schemes above described was never documented as an official way to open the the sharing dialog.

BUT

There is the new AppLinks framework.

The App Links framework is documented here

What it does is basically allows you to have meta tags on certain URLs that let you launch your (or any) app from Facebook. Basically Facebook checks if your page supports an app link and then links directly to your app

So, theoretically it should be simple to launch the Facebook app from your browser if you have it and if not load another link. (which is basically what you need). However even though Facebook created it they haven't put it on their pages yet. (in other words in the future these meta tags might work to open the apps).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM