Package com.gwtmobile.phonegap.client.plugins.Facebook

Examples of com.gwtmobile.phonegap.client.plugins.Facebook.Callback


  public void login() {
    if (!initialized) {
      text.setHTML("Facebook plugin not initialized.");
      return;
    }
    Facebook.login(new Callback() {
      @Override
      public void onSuccess(Response response) {
        text.setHTML("Response from login:<br/>" +
            "Status:" + response.getStatus() + "<br/>" +
            ((response.getSession() == null) ? "" :
View Full Code Here


  private void getLoginStatus() {
    if (!initialized) {
      text.setHTML("Facebook plugin not initialized.");
      return;
    }
    Facebook.getLoginStatus(new Callback() {
      @Override
      public void onSuccess(Response response) {
        text.setHTML("Response from getLoginStatus:<br/>" +
            "Status:" + response.getStatus() + "<br/>" +
            ((response.getSession() == null) ? "" :
View Full Code Here

  private void post() {
    if (!initialized) {
      text.setHTML("Facebook plugin not initialized.");
      return;
    }
    Facebook.getLoginStatus(new Callback() {
      @Override
      public void onSuccess(Response response) {
        Session session = response.getSession();
        if (session == null) {
          text.setHTML("Need to login to Facebook first.");
          return;
        }
        String path = session.getUserID() + "/feed";
        Params params = Params.createParams();
        final String message = "I am checking out the GWT Mobile PhoneGap app!";
        params.set("message", message);
        Facebook.api(path, "post", params, new Callback() {
          @Override
          public void onSuccess(Response response) {
            if (response.get("id") != null) {
              text.setHTML("Message \"" + message + "\" has been posted to your facebook wall.<br/>"
                  + "id:" + response.get("id"));
View Full Code Here

  private void logout() {
    if (!initialized) {
      text.setHTML("Facebook plugin not initialized.");
      return;
    }
    Facebook.logout(new Callback() {
      @Override
      public void onSuccess(Response response) {
        text.setHTML("Response from logout:<br/>" +
            "Status:" + response.getStatus() + "<br/>" +
            ((response.getSession() == null) ? "" :
View Full Code Here

TOP

Related Classes of com.gwtmobile.phonegap.client.plugins.Facebook.Callback

Copyright © 2018 www.massapicom. 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.