0

im new to Facebook4j and im looking for a way to post message using it. i just learned few of the coding in the internet. Please someone help me.

This are what i have done :

import facebook4j.Facebook;
import facebook4j.FacebookException;
import facebook4j.FacebookFactory;
import facebook4j.conf.Configuration;
import facebook4j.conf.ConfigurationBuilder;

public class post {

public static void main(String[] args) 
        throws FacebookException 
{ 
    // Create conf builder and set authorization and access keys 
    ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
    configurationBuilder.setDebugEnabled(true); 
    configurationBuilder.setOAuthAppId("xxxx");
    configurationBuilder.setOAuthAppSecret("xxxx");
    configurationBuilder.setOAuthAccessToken("xxxx");
    configurationBuilder .setOAuthPermissions("email, publish_stream, id, name, first_name, last_name, read_stream , generic");
    configurationBuilder.setUseSSL(true);


    // Create configuration and get Facebook instance 
    Configuration configuration = configurationBuilder.build(); 
    FacebookFactory ff = new FacebookFactory(configuration);
    Facebook Facebook = ff.getInstance(); 


    Facebook.postStatusMessage("Hello World from Facebook4J.");


}

    }

so, what i need to do next?

  • 1
    Go through the documentation examples at http://facebook4j.org/en/code-examples.html – neetesh Jan 18 '16 at 06:22
  • Also see [this](http://stackoverflow.com/help/how-to-ask) for information on how to ask a good question on stackoverflow. – Sam Jan 18 '16 at 06:33

1 Answers1

0

Have you created and authorized your app on https://developers.facebook.com ?

This is actually the first step.