Start a new topic

Kinvey Android Facebook login is not working

I followed steps mentioned in below URL

Steps mentioned in this url belongs to old Facebook API. 

I even try your GIT URL:

and gradle:

Here facebook sdk version is: 

compile ''

But latest version is: 4.7.0

So, the tutorial totally not working. And the documentation refers to old Facebook version. We are planning to use kinvey BAAS in our project but old documentation doesn't let us try the product.

Can you please provide latest documentation so that I do not have to waste my time on obsolete API's 


Hello Surinder,

Our apologies for the delay in us updating our documentation.  The guide was a little outdated, but worked fine until the API version change at facebook a couple of months back.  I'll flag that article for an update to ensure that someone takes a look at it as soon as possible.


Thanks for a quick response. But in the mean time can you provide me any working facebook kinvey login, any git repo. I need to do a demo to the client. 



Hi Surinder,

I have emailed you the link to a basic app separately.

I will outline the general steps here:

  1. Create the facebook app (quite a few clicks and then you get the facebook app id)
  2. Create the kinvey app (get the kinvey app id and app secret)
  3. Put following code in onCreate of your Activity (to launch Facebook LoginManager at app startup)


        mCallbackManager = CallbackManager.Factory.create();
        LoginManager.getInstance().logInWithReadPermissions(this, Arrays.asList("public_profile"));
                new FacebookCallback<LoginResult>() {
                    public void onSuccess(LoginResult loginResult) {
                        Log.d("KinveyAndroidFb", "Login");
                        AccessToken accessToken = AccessToken.getCurrentAccessToken();
                        Log.d("KinveyAndroidFb", accessToken.getToken());
                        final Client mKinveyClient = new Client.Builder("<kinvey-app-id-here>", "<kinvey-app-secret-here>", getApplicationContext()).build();
                        mKinveyClient.user().loginFacebook(accessToken.getToken(), new KinveyUserCallback() {
                            public void onFailure(Throwable e) {
                                Log.e("KinveyAndroidFb", "failed Kinvey facebook login", e);
                            public void onSuccess(User u) {
                                Log.d("KinveyAndroidFb", "successfully logged in with facebook");

                    public void onCancel() {
                        Toast.makeText(MainActivity.this, "Login Cancelled", Toast.LENGTH_LONG).show();

                    public void onError(FacebookException exception) {
                        Toast.makeText(MainActivity.this, exception.getMessage(), Toast.LENGTH_LONG).show();


And as Damien said earlier, we will flag the documentation and the sample apps for update.

Login or Signup to post a comment