有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java如何使用Facebook的FacebookSDK和其他平台的意图共享内容?

我一直在使用Intents与Facebook分享我的应用程序中的内容,而且它工作得非常好。 关键是,当我使用Intents在Facebook上共享任何内容时,共享内容不会“链接”到我在Facebook上注册的应用程序

现在,我试图从选择器中捕获用户的选择,然后使用Facebook的Facebook SDK和其他平台的意图

我尝试了下面的代码,但只有在用户被重定向到所选平台后,接收器才会被执行。此外,从一个接收者内部,我无法获得需要实例化SharedDialog的活动

“'

    Intent shareContentIntentReceiver = new Intent(this.context, ShareContentIntentReceiver.class);
    PendingIntent pendingIntent = PendingIntent.getBroadcast(this.context, 0, shareContentIntentReceiver, PendingIntent.FLAG_UPDATE_CURRENT );

    //String type = "image/*";
    Intent intentShare = new Intent(Intent.ACTION_SEND);
    intentShare.setType("text/plain");
    intentShare.putExtra(Intent.EXTRA_TEXT, "URL_TO_BE_SHARED");

    this.context.startActivity(Intent.createChooser(intentShare, "Title Chooser", pendingIntent.getIntentSender()));

“'

有人知道这是否可能,以及我如何做到这一点吗

谢谢


共 (0) 个答案