Package com.restfb

Examples of com.restfb.DefaultFacebookClient.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

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.