FacebookLogin Library

Lightweight Facebook Login Library for Android

License

License

GroupId

GroupId

com.greenhalolabs
ArtifactId

ArtifactId

facebooklogin
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

aar
Description

Description

FacebookLogin Library
Lightweight Facebook Login Library for Android
Project URL

Project URL

https://github.com/greenhalolabs/FacebookLogin
Source Code Management

Source Code Management

https://github.com/greenhalolabs/FacebookLogin

Download facebooklogin

How to add to project

<!-- https://jarcasting.com/artifacts/com.greenhalolabs/facebooklogin/ -->
<dependency>
    <groupId>com.greenhalolabs</groupId>
    <artifactId>facebooklogin</artifactId>
    <version>1.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.greenhalolabs/facebooklogin/
implementation 'com.greenhalolabs:facebooklogin:1.0'
// https://jarcasting.com/artifacts/com.greenhalolabs/facebooklogin/
implementation ("com.greenhalolabs:facebooklogin:1.0")
'com.greenhalolabs:facebooklogin:aar:1.0'
<dependency org="com.greenhalolabs" name="facebooklogin" rev="1.0">
  <artifact name="facebooklogin" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.greenhalolabs', module='facebooklogin', version='1.0')
)
libraryDependencies += "com.greenhalolabs" % "facebooklogin" % "1.0"
[com.greenhalolabs/facebooklogin "1.0"]

Dependencies

compile (1)

Group / Artifact Type Version
com.android.support » appcompat-v7 jar 20.0.0

Project Modules

There are no modules declared in this project.

Facebook Login Library

Lightweight version of the Facebook SDK. Its main purpose is to Login with Facebook and obtain the user's Access Token.

Including FacebookLogin using Gradle:

Add the following to your build.gradle:

	repositories {
    	mavenCentral()
	}
	dependencies {
		compile 'com.greenhalolabs:facebooklogin:1.0'
	}

Instructions

In the Facebook Developers site, add the Android Key Hash to your App. See https://developers.facebook.com/docs/android/getting-started.

If needed, set the following properties in gradle.properties depending on your app's requirements. See https://github.com/greenhalolabs/facebooklogin/blob/master/gradle.properties.

ANDROID_BUILD_MIN_SDK_VERSION=15
ANDROID_BUILD_TARGET_SDK_VERSION=19
ANDROID_BUILD_SDK_VERSION=19
ANDROID_BUILD_TOOLS_VERSION=20.0.0

In your app's AndroidManifest.xml file, add a reference to FacebookLoginActivity. See https://github.com/greenhalolabs/facebooklogin/blob/master/sample/src/main/AndroidManifest.xml.

<activity android:name="com.greenhalolabs.facebooklogin.FacebookLoginActivity" />

To launch Facebook Login, here's a sample:

String applicationId =  getResources().getString(R.string.facebook_app_id);
ArrayList<String> permissions = new ArrayList<String>();
permissions.add("public_profile");
FacebookLoginActivity.launch(this, applicationId, permissions);

To get Access Token, use onActivityResult,

@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {

        if (requestCode == FacebookLoginActivity.FACEBOOK_LOGIN_REQUEST_CODE) {

            if (resultCode == Activity.RESULT_OK) {
                String accessToken = data.getStringExtra(FacebookLoginActivity.EXTRA_FACEBOOK_ACCESS_TOKEN);
                Toast.makeText(this, "Access Token: " + accessToken, Toast.LENGTH_LONG).show();
            }
            else {
                String errorMessage = data.getStringExtra(FacebookLoginActivity.EXTRA_ERROR_MESSAGE);
                Toast.makeText(this, "Error: " + errorMessage, Toast.LENGTH_LONG).show();
            }

        }
    }
com.greenhalolabs

Green Halo Labs

Versions

Version
1.0