Package com.restfb

Examples of com.restfb.FacebookClient.publish()


 
  @SuppressWarnings("unused")
  public static void publishScore(String score, String userId) {
    Long realScore = Long.valueOf(score);
    FacebookClient facebookClient = new DefaultFacebookClient(Constants.APP_ACCES_TOKEN);
    Boolean publishScoreResponse = facebookClient.publish(userId +"/scores", Boolean.class,
        Parameter.with("score", realScore.intValue()));
  }

  @SuppressWarnings("unused")
  public static void postScoreToWall(String username, String score) {
View Full Code Here


    Player player = DatastoreHelper.getPlayer(username);
   
    String accessToken = player.getAccessToken();
   
    FacebookClient facebookClient = new DefaultFacebookClient(accessToken);
    FacebookType postScoreToWallResponse = facebookClient.publish("me/feed", FacebookType.class,
        Parameter.with("message", "just scored " + score + " on stewiemaze"));
   
  }
 
  @SuppressWarnings("unused")
View Full Code Here

   
    String accessToken = player.getAccessToken();
    String score = player.getHighscore() + "";
   
    FacebookClient facebookClient = new DefaultFacebookClient(accessToken);
    FacebookType postScoreToWallResponse = facebookClient.publish("me/feed", FacebookType.class,
        Parameter.with("message", message));
   
  }

}
View Full Code Here

    publish(accessToken, FB_ME, message);
  }
 
  public void publish(String accessToken, String facebookId, String message) {
    FacebookClient fb = createFacebookClient(accessToken);
    fb.publish(facebookId + FB_FEED, FacebookType.class, Parameter.with(FB_MESSAGE, message));
  }
 
  public void publishLink(String accessToken, String link, String message, String image, String caption,
      String description) {
    publishLink(accessToken, FB_ME, link, message, image, caption, description);
View Full Code Here

  }
 
  public void publishLink(String accessToken, String facebookId, String link, String message, String image,
      String caption, String description) {
    FacebookClient fb = createFacebookClient(accessToken);
    fb.publish(facebookId + FB_FEED, FacebookType.class, Parameter.with(FB_LINK, link),
      Parameter.with(FB_MESSAGE, message), Parameter.with(FB_PICTURE, image),
      Parameter.with(FB_CAPTION, caption), Parameter.with(FB_DESC, description));
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.