开发者

How to use Java to create a facebook event with photo(png or jpg)

How to use Java to create a facebook event with photo(png or jpg)

Is there anyone can share the scope and value

Thanks a lot.

When I read the graph-api document, 开发者_如何学PythonI still can not figure out the scope.


Just use RestFB. The example below is taken from the truly excellent documentation on the website:

// Publishing an image to a photo album is easy!
// Just specify the image you'd like to upload and RestFB will handle it from there.
FacebookClient facebookClient = new DefaultFacebookClient(MY_ACCESS_TOKEN);
FacebookType publishPhotoResponse = facebookClient.publish("me/photos", FacebookType.class,
  BinaryAttachment.with("cat.png", getClass().getResourceAsStream("/cat.png")),
  Parameter.with("message", "Test cat"));

out.println("Published photo ID: " + publishPhotoResponse.getId());
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜