Skip to content
A utility library to authenticate ParseUsers with the Facebook SDK
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper Upgrade versions May 31, 2018
library Formatting Mar 6, 2019
.gitignore (っ˘▽˘)っ ☁️ ⊂(◕。◕⊂) Oct 7, 2015
.travis.yml Fix Travis builds Mar 5, 2019
CODE_OF_CONDUCT.md
LICENSE
PATENTS transfer code Apr 5, 2017
README.md Remove dead coverage link Jul 17, 2018
build.gradle
gradlew (っ˘▽˘)っ ☁️ ⊂(◕。◕⊂) Oct 7, 2015
gradlew.bat
settings.gradle

README.md

Parse Facebook Utils for Android

Build Status License

A utility library to authenticate ParseUsers with the Facebook SDK. For more information, see our guide.

Dependency

Add this in your root build.gradle file (not your module build.gradle file):

allprojects {
	repositories {
		...
		maven { url "https://jitpack.io" }
	}
}

Then, add the library to your project build.gradle

dependencies {
    implementation 'com.github.parse-community:ParseFacebookUtils-Android:latest.version.here'
}

Usage

Extensive docs can be found in the guide. The basic steps are:

// in Application.onCreate(); or somewhere similar
ParseFacebookUtils.initialize(context);

Within the activity where your user is going to log in with Facebook, include the following:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  super.onActivityResult(requestCode, resultCode, data);
  ParseFacebookUtils.onActivityResult(requestCode, resultCode, data);
}

Then elsewhere, when your user taps the login button:

ParseFacebookUtils.logInWithReadPermissionsInBackground(this, permissions, new LogInCallback() {
  @Override
  public void done(ParseUser user, ParseException err) {
    if (user == null) {
      Log.d("MyApp", "Uh oh. The user cancelled the Facebook login.");
    } else if (user.isNew()) {
      Log.d("MyApp", "User signed up and logged in through Facebook!");
    } else {
      Log.d("MyApp", "User logged in through Facebook!");
    }
  }
});

How Do I Contribute?

We want to make contributing to this project as easy and transparent as possible. Please refer to the Contribution Guidelines.

License

Copyright (c) 2015-present, Parse, LLC.
All rights reserved.

This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.

As of April 5, 2017, Parse, LLC has transferred this code to the parse-community organization, and will no longer be contributing to or distributing this code.

You can’t perform that action at this time.