@FXML
public void shareFacebookClicked() throws Exception{
String appID = "MY_APP_ID";
String appSecret = "MY_APP_SECRET";
String accessToken = "MY_ACCESS_TOKEN";
FacebookClient facebookClient = new DefaultFacebookClient(accessToken, appSecret, Version.VERSION_2_3);
String proof = new DefaultFacebookClient().obtainAppSecretProof(
accessToken, appSecret);
System.out.println("Here's my proof: " + proof);
FacebookType publishMessageResponse =
facebookClient.publish("me/feed", FacebookType.class,
Parameter.with("message", "RestFB test"));
System.out.println("Published message ID: " + publishMessageResponse.getId());
Hi Daniel,
Please add Parameter.with("appsecret_proof",proof) next to your Parameter.with('message', 'RestFB Test').
This should work.
Norbert
String appID = "MY_APP_ID";
String appSecret = "MY_APP_SECRET";
String accessToken = "MY_ACCESS_TOKEN";
FacebookClient facebookClient = new DefaultFacebookClient(accessToken, appSecret, Version.VERSION_2_3);
String proof = new DefaultFacebookClient().obtainAppSecretProof(
accessToken, appSecret);
System.out.println("Here's my proof: " + proof);
FacebookType publishMessageResponse =
facebookClient.publish("me/feed", FacebookType.class,
Parameter.with("message", "RestFB test"),
Parameter.with("appsecret_proof", proof));
System.out.println("Published message ID: " + publishMessageResponse.getId());
An publishing integration test works, too. You can have a look at the current dev branch or here:
https://github.com/restfb/restfb/issues/243
Norbert