通过FBSDKShareDialog共享将忽略目标页面上定义的应用链接 [英] Share via FBSDKShareDialog ignores applink defined on target page

查看:166
本文介绍了通过FBSDKShareDialog共享将忽略目标页面上定义的应用链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这整天让我发疯:

我有一个定义了自定义URL方案的iOS应用,并尝试在FB上共享一个链接,该链接指向转到在其applink元标记中具有此方案的页面,以便点击它可以启动我的应用程序。

I have an iOS app with a custom URL scheme defined, and am trying to share a link on FB which points to a page that has this scheme in its applink meta tags, so that tapping it should fire up my app.

其中的每一小部分都可以正常工作。我可以在手机上的野生动物园中输入URL方案,然后浏览器启动我的应用程序。我已经使用FB调试工具测试了我的网页,没有任何错误或警告-它可以正确识别所有元标记。

Every little piece of it is working just fine. I can enter my URL scheme in safari on the phone and the browser launches my app. I have tested my webpage with the FB debug tool and there are no errors or warnings - it correctly identifies all the meta tags.

如果我在FB上使用FB共享链接,

If I share the link using FB on the phone or on my laptop, all works fine.

但是,如果我使用FBSDKShareDialog共享 exact 相同的链接,那么它将无法正常工作。它只是打开带有meta标签的网页,就像打开任何普通网页一样。

HOWEVER, if I share the exact same link using FBSDKShareDialog, it does not work. It just opens the web page with the meta tags as if it was any regular web page.

任何人都知道为什么这两种共享方式会有所不同吗?否则它们看起来完全一样。

Anyone has any idea why these two ways of sharing would be different? They look exactly the same otherwise.

推荐答案

如果还有其他人遇到此问题,以下是FB的答复:

If anyone else runs into this problem, here's the reply from FB:



  1. 使用自动模式共享时,该应用程序会快速将应用程序切换到FB应用程序以显示本机共享对话框

  2. 帖子在设备上本地缓存,并且不知道应用程序链接(因为只有Facebook服务器端知道)

  3. 何时用户打开FB,用户看到其缓存的故事(无应用链接行为),

Web模式,因为Facebook应用程序需要
从服务器中获取帖子,在这种情况下,它具有
应用程序链接的所有信息。

This doesn't manifest with the Web mode since the Facebook app needs to pull from the server to get the post, in which case it has all the app links info.

我们不太可能解决此问题。但是,过一会儿,
缓存将过期,Facebook应用程序将从
服务器重新拉出帖子,在这种情况下,应用程序链接数据将可用。

This is unlikely something that we'll fix. However, after a while, the cache will expire, and Facebook app will re-pull the posts from the servers, in which case the app link data will be available.

要对此进行测试,可以在一个设备上共享该帖子,然后
尝试在另一台设备上单击该帖子。应用程序链接应该在该时刻
起作用。

In order to test this, you can share the post on one device, and then try clicking on the post from another device. The app links should work at that point.

这是IMO的一种me脚响应-他们解析目标页面要建立预览,记住应用链接并使用它会有多困难?

Which is kind of a lame response IMO - they parse the target page to build the preview, how hard would it be to remember the applink and use it?

这篇关于通过FBSDKShareDialog共享将忽略目标页面上定义的应用链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆