【问题标题】:How to filter facebook share intent in android?如何在android中过滤facebook分享意图?
【发布时间】:2016-06-04 15:19:39
【问题描述】:

我有一个分享按钮。我与一些文本和 URL 共享一条消息。它适用于 whatsapp、Twitter 和 Gmail。但是,在 facebook 分享中,我只能分享网站链接。之后,在网上搜索我找到了 Facebook 共享的 ShareDialog 类。我的问题是当用户单击 android 默认共享对话框上的 facebook 图标时如何检测(例如:onClick() 用于 facebook 图标)。这是正确的方法吗?还是有其他替代品?

我的代码:

public void shareApp() {       
    Intent sendIntent = new Intent();
    String websiteLink = "https://www.manam.com";
    String playStoreLink = "http://www.google.com";
    String msg = "\nHey, found this cool & easy on-demand app.";
    sendIntent.setAction(Intent.ACTION_SEND);
    sendIntent.putExtra(Intent.EXTRA_SUBJECT, msg);
    sendIntent.putExtra(Intent.EXTRA_TEXT,playStoreLink + msg);
    sendIntent.setType("text/plain");
    startActivity(Intent.createChooser(sendIntent, ""));
}

【问题讨论】:

    标签: android


    【解决方案1】:

    这是 Facebook 的政策。 当您实现共享时,您的应用不应预先填充任何要共享的内容。这与 Facebook 平台政策不一致,请参阅Facebook Platform Policy, 2.3。 我也没有看到检测点击 facebook 图标的选项。即使您可以显示您的共享对话框,您也无法预先填写任何数据

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多