The easy way use Facebook Library.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
gradle/wrapper
mcfacebook
.gitignore
README.md
build.gradle
gradle.properties
settings.gradle

README.md

MCFacebook

The easy way use Facebook Library.

Usage

  • 1 - Add library
compile 'com.mobileia:mcfacebook:0.1.5'
  • 2- Add in Manifest and replace "{facebook_id}" for your App ID. (You do not forget to add Key Hashes in Facebook Developer.)
    ...
  
  
        
        
        
        
        
        
    
    
    

Login with Facebook

  • 1 - Extend activity for BaseFacebookActivity
public class LoginActivity extends BaseFacebookActivity
  • 2 - Implement methods required.
@Override
public void onSuccessLoginWithFacebook(MCUserFacebook mcUserFacebook) {
      System.out.println("Facebook Data: " + mcUserFacebook.id + mcUserFacebook.fullname + mcUserFacebook.email + mcUserFacebook.picture);
}
  • 3 - How to call facebook log in?
loginWithFacebook(Arrays.asList("public_profile", "user_photos", "email"));
  • 3b - Example:
ImageButton btnFacebook = (ImageButton)findViewById(R.id.btnFacebook);
btnFacebook.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
         loginWithFacebook(Arrays.asList("public_profile", "user_photos", "email"));
      }
});

About