【问题标题】:Programmatically get like count of a photo from Facebook using java使用 java 以编程方式从 Facebook 获取照片的数量
【发布时间】:2017-01-15 16:10:14
【问题描述】:

我正在开发一个在 Facebook 上发布照片的 Android 应用,同时我想从我的 Android 应用中计算该照片的点赞数。

有关信息 - 我正在使用 Facebook SDK,并且我已成功登录 Facebook 帐户并发布了图片。

下图的方法

private void PublishImage()
{
    Bitmap image = BitmapFactory.decodeResource(getResources(),R.mipmap.ic_launcher);

    //Here we set all the required parameters to share the image and build that
    SharePhoto photo = new SharePhoto.Builder()
            .setBitmap(image)
            .setCaption("Testing Sharing Feature through java")
            .build();
    //Now we share the PhotoContent by adding the properties in instance of SharePhotoContent
    share = new SharePhotoContent.Builder()
            .addPhoto(photo)
            .build();

    //Now we use share API to share the image
    ShareApi.share(share,null);

}

如何使用java而不是手动使用Graph API Explorer来计算张贴照片的点赞数?

【问题讨论】:

    标签: java android facebook-android-sdk facebook-java-api


    【解决方案1】:

    我认为如果没有图形 API,您将无法做到这一点。一旦你调用了ShareApi.share(),实际上有一个上传照片的图API请求,你会得到来自各个平台的点赞,你的应用无法知道点赞了多少

    【讨论】:

    • 我不想手动使用graph api,而是想用java调用它
    • 它最终将是一个 Java 编写的代码,它可以做任何事情。您将使用 Facebook 的 Android SDK(用 Java 编写)与图形 API 进行交互,并通过其 id 获取有关特定图片的信息
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多