简体   繁体   English

如何直接从浏览器打开Facebook App共享视图

[英]How to open Facebook App from browser directly to share view

EDIT : What are all the custom URL schemes supported by the Facebook iPhone app? 编辑Facebook iPhone应用程序支持的所有自定义URL方案是什么?

I have got a web page where I got a Facebook sharing button. 我有一个网页,我有一个Facebook分享按钮。

Now, I am dealing with iPhone users with already installed Facebook App . 现在,我正在与已安装Facebook App iPhone用户打交道。

When the user clicks share on the page I do not want to open Facebook page, I would like to open the Facebook App for him. 当用户点击页面上的share我不想打开Facebook页面时,我想为他打开Facebook App。

I have already added a piece of code: 我已经添加了一段代码:

<a href="fb://" id="shareButton">Open FB Profile</a>

This piece of code will open for user Facebook App. 这段代码将为用户Facebook App打开。 I would like to open the App directly with sharing view. 我想直接用共享视图打开App。 Let's say I would like to open the App with link https://stackoverflow.com/ and waiting for user confirmation (or even just post it without any user contribution). 假设我想通过链接https://stackoverflow.com/打开应用程序并等待用户确认(甚至只是发布它而不需要任何用户贡献)。

I found a page with IPhone URL Schemes but there is not something like fb://share . 我找到了一个包含IPhone URL Schemes的页面,但是没有像fb://share这样的东西。

Has someone already implemented this way of sharing data with Facebook App? 有人已经实现了这种与Facebook App共享数据的方式吗?

I will be really happy to see your solutions and, if it is possible, a piece of code. 我很高兴看到您的解决方案,如果可能的话,我会很高兴看到一段代码。

I tried to use 我试着用

<a href="fb://post?message=helloworld" id="shareButton">Open FB Profile</a>

but nothing happens - it still opens Facebook App but there is not any post on my timeline. 但没有任何反应 - 它仍然打开Facebook App但我的时间线上没有任何帖子。 In fact, even fb://map opens the Facebook App in main view... 事实上,甚至fb://map也会在主视图中打开Facebook App ...

Thank you in advance 先感谢您


EDIT: 编辑:

I tried to use another way to publish something but it is not what I really want to do. 我试图用另一种方式发布一些东西,但这不是我真正想做的事情。 I would like to open Facebook App with dialog and ask user to share something(in fact, to accept what I want to share). 我想用对话框打开Facebook App,并要求用户分享一些东西(事实上,接受我想要分享的内容)。

With the Graph API Explorer I am able to do a GET / POST to the current Facebook profile. 使用Graph API Explorer,我可以对当前的Facebook个人资料进行GET / POST I wrote also an easy JS script which does the same action: 我还写了一个简单的JS脚本,它执行相同的操作:

<script type="text/javascript">
    function publishOnFacebook() {
        var xmlhttp = new XMLHttpRequest();

        xmlhttp.onreadystatechange = function () {
            if (xmlhttp.readyState == 4) {
                console.log(xmlhttp.status);
            }
        }

        xmlhttp.open("POST", "https://graph.facebook.com/me/feed?" +
                "message=https://stackoverflow.com/q/25313299/1021970" +
                "&access_token=my_token", true);
        xmlhttp.send();
    }
</script>

It works, but it is not exactly what I want to. 它有效,但它不是我想要的。 It looks like this: 它看起来像这样:

发表的帖子

without any picture or preview. 没有任何图片或预览。

The Facebook app does not officially support deep linking so what you are trying to do is not possible (right now). Facebook应用程序不正式支持深层链接,所以你想要做的事情是不可能的(现在)。

A bigger problem I see, how will you check if the Facebook app is already installed? 我看到一个更大的问题,你如何检查Facebook应用程序是否已经安装? Mobile Safari does not provide such functionality and trying to open an URL scheme the iOS device does not understand will lead to an ugly error message, just sayin'... Mobile Safari不提供此类功能,尝试打开iOS设备无法理解的URL方案会导致丑陋的错误消息,只是说'...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如果从我的网站在浏览器中安装了其他应用程序,如何在移动应用程序中打开共享对话框? - How to open share dialog in mobile app if installed else in browser from my website? 如何从网站链接打开 Facebook 应用程序 - how to open facebook app from website link 如何避免用户直接在浏览器中打开弹出窗口? - How to avoid user to open popup directly in the browser? 如何从移动网站(不是应用程序)打开共享对话框? - How to open share dialog from mobile website(not app)? 在默认浏览器中从Facebook浏览器安装的Facebook中打开我的网站 - Open my site in default browser from facebook insted of facebook browser 浏览器从Facebook应用程序检索Facebook凭证 - browser retrieve facebook credentials from facebook app 如何防止应用浏览器中的Facebook打开我的网站链接? - How to prevent Facebook in app browser from opening my website links? 有没有办法强制从Facebook的应用内浏览器中打开Chrome链接? - Is there any way to force a link to open in Chrome from Facebook's in-app browser? 如何从Appcelerator Android应用程序打开Facebook Album? - How to open Facebook Album from Appcelerator Android app? 如何通过浏览器重定向打开移动应用程序(例如 Facebook)? - How can I open a mobile app (eg Facebook) via a browser redirect?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM