Latest 9.4.5
License MIT
Platforms ios 9.0
Dependencies FacebookCore, FacebookLogin, Cidaas-SDK

More about CIDaaS

To know more about Cidaas visit CIDaaS

CIDaaS Documentation


minSdkVersion 18


Cidaas-Facebook is available through Github. To install it, add the following line to your app level gradle file:

Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        maven { url '' }

Add the dependency

    dependencies {
    compile 'com.github.Cidaas:cidaas-facebook:18.1.+'

Creating Facebook App

The following steps are to be followed to create a Facebook App

  1. Once Gradle sync is completed, Go to the Facebook Developers Console, add a new App then give it a valid name and click "Create App Id"
  2. Take note of the App ID
  3. On the left side, you have the navigation drawer. Click Settings and then Basic
  4. Click Add Platform and Choose Android
  5. Fill the Package name, Class name and Key Hash

To know the Key Hash, Enter the following command in Terminal or Command Prompt

For windows :
    keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%.androiddebug.keystore | openssl sha1 -binary | openssl base64
For Mac :
    keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
  1. Turn on "Single Sign On" and click "Save changes"

Getting Started

The following steps are to be followed to use this Cidaas-Facebook

  1. Mention the facebook App Id in the project’s strings.xml file
<string name="facebook_app_id">your facebook app id</string>
  1. Add the following meta data in your App’s Manifest file
  1. In your project’s Activity file Create an instance for CidaasFacebook class
CidaasFacebook cidaas;
CidaasSDK cidaas;
  1. Inside your onCreate() method, initialize the instance by passing the current activity as an argument
cidaasFacebook = new CidaasFacebook(this);
cidaas = new CidaasSDK(this);
cidaas.setURLFile(getAssets(), "properties.xml");
  1. To sign in using CidaasFacebook, call facebookLogin() method
cidaasFacebook.facebookLogin(new IAccessTokenEntity() {
    public void onSuccess(AccessTokenEntity accessTokenEntity) {
        Toast.makeText(getApplicationContext(), accessTokenEntity.getAccessToken(), Toast.LENGTH_SHORT).show();

    public void onError(ErrorEntity errorEntity) {
        Toast.makeText(getApplicationContext(), errorEntity.getMessage(), Toast.LENGTH_SHORT).show();
  1. Override your activity’s onActivityResult() method and redirect the received parameters to the CidaasFacebook instance’s authorize() method
cidaasFacebook.authorize(requestCode, resultCode, data);

Sample Code


    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android=""

            android:text="Facebook Login"
            android:layout_height="wrap_content" />

    package com.widas.facebooksdk;

    import android.content.Intent;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;
    import android.widget.Toast;
    import com.widas.cidaasfacebook.CidaasFacebook;
    import com.widas.cidaasfacebook.CidaasFacebookCallback;

    public class MainActivity extends AppCompatActivity {
        public CidaasFacebook cidaas;

        protected void onCreate(Bundle savedInstanceState) {
            cidaas = new CidaasFacebook(this, getString(R.string.facebook_app_id));
            Button btn_login = (Button) findViewById(;
            btn_login.setOnClickListener(new View.OnClickListener() {
                public void onClick(View v) {

        protected void onActivityResult(int requestCode, int resultCode, Intent data) {
            CidaasFacebook.facebookCallback = new CidaasFacebookCallback() {
                public void onSuccess(String message) {
                    Toast.makeText(getApplicationContext(), "Access Token :" + message, Toast.LENGTH_LONG).show();
                public void onCancel(String message) {
                    Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();
                public void onError(String message) {
                    Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();
            cidaas.authorize(requestCode, resultCode, data);
            super.onActivityResult(requestCode, resultCode, data);

Screen Shots

Screen 1Screen 2

Help and Support

For more support visit CIDaaS Support

Latest podspec

    "name": "Cidaas-Facebook",
    "version": "9.4.5",
    "summary": "A short description of Cidaas-Facebook.",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Cidaas": "[email protected]"
    "source": {
        "git": "",
        "tag": "9.4.5"
    "platforms": {
        "ios": "9.0"
    "source_files": "Cidaas-Facebook/Classes/**/*",
    "dependencies": {
        "FacebookCore": [
        "FacebookLogin": [
        "Cidaas-SDK": [
            "~> 9.4"
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This