Backendless default app facebook sign in

Is it possible to set this to the name of my app instead of backendless default app sign in when a user signs in with their facebook with the easy facebook sign in using the backendless SDK?

Are you talking about Facebook login into your app?

Correct. Attached is a screenshot

Have you configured your Backendless backend with the Facebook APP ID and Secret key:

http://support.backendless.com/public/attachments/6a8fe4ce564aaa14f9cf2f4334e09e97.jpg</img>

It appeared i didn’t have that setup, I do have that setup now with the Facebook credentials in the backendless backend as you have shown, I’m getting an error now though (see attached). I haven’t added the Facebook SDK dependency in my build.gradle although i’m not using the login with the Facebook SDK so wouldnt think I need to add that? Not sure what the issue is.

Please make sure to follow the instructions from this page in the docs:

https://backendless.com/documentation/manage/mgmt_social_settings.htm

Regards,
Mark

Hi Mark, thanks its working now. Just a note on your documention the steps have changed only slightly from Facebook documention: It follows Setting > Add Platform > add Website

You will see Site URL:
Then I entered in https://api.backendless.com

Just some productive feedback.

Cheers

Leonard

Solved this issue. Cheers

Hi Leonard,

What has changed between the time when you said it is working and now?

Regards,
Mark

When I initially setup the facebook page for my app i setup with android, so I just deleted the app on the facebook and started again but with the web platform and followed the instructions again without adding an android platform and this seemed to remove the error i was having.

So is it working now?

Not completely, I get the login in webView pop up with my apps name and logo, but when i put in my facebook email and password and click login I get an error. Checking the backendless backend in the email properties i get a bunch of digits of the newly created user but not the email address I was expecting. See photos of app.

My users email property is custom at that moment, below is my code for the faebook login

facebookButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Map<String, String> facebookFieldMappings = new HashMap<String, String>() {{
put(“password”, “password”);
put(“email”, “email”);
put(“gender”, “gender”);
put(“last_name”, “lname”);
put(“first_name”, “fname”);
}};

List<String> permissions = new ArrayList<>();
permissions.add(“public_profile”);
permissions.add(“user_friends”);
permissions.add(“email”);

Backendless.UserService.loginWithFacebook(MainActivity.this, null, facebookFieldMappings, permissions, new AsyncCallback<BackendlessUser>() {
@Override
public void handleResponse(BackendlessUser response) {

Person p = new Person();
p.setGender((String) response.getProperty(“gender”));
p.setLname((String) response.getProperty(“lname”));
p.setFname((String) response.getProperty(“fname”));
p.setFullname(response.getProperty(“fname”) + " " +
response.getProperty(“lname”));
p.setEmail((String) response.getProperty(“email”));
try {
new Save(p, response).execute().get();
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
}
}

@Override
public void handleFault(BackendlessFault fault) {
Toast.makeText(getApplicationContext(), fault.getMessage(), Toast.LENGTH_SHORT).show();
}
}, false);
}
});

Could you please grab the latest build of backendless.jar from the link below and try again:

https://github.com/Backendless/Android-SDK/tree/master/out

Thanks,
Mark

Hi Mark, have grabbed the latest build unfortunately the issue still persists BackendlessFault{ code: ‘IllegalArgumentException’, message: ‘org.json.JSONObject$1 cannot be cast to java.lang.String’ }

At what point does the error occur?

The error occurs after I have clicked Log in button the webView to sign in with Facebook with my Facebook credentials filled in. I have attached a screenshot with a breakpoint where the error occurs

Hi Leonard,
No luck reproducing your error using the latest backendless.jar in project.
Can you please show the stacktrace of the error?
And can you try the code from code generation login sample? (Code Generation tab in Backendless console, choose facebook login checkbox). Does it work for you?

Concerning digits in email property - this will be fixed in the upcoming release.

Thanks for the reply, I think have identified the issue, its not getting all the Facebook field mappings since I had configured Backendless backend with the Facebook APP ID and Secret key even though I have declared field mappings in the method. My permissions are also declared. Im getting the digits for the email and maybe the password I think but the gender, first and last name does not exist in the BackendlessUser response.

The additional fields are not getting mapped which is my issue currently, again i have attached a screenshot showing the null properties of the user response in the handle response method.

Would be great to get the email in the next update to btw!

Many Thanks
Leonard

Hi Leonard!

Issues with email property and fields mapping already fixed. Please try again.
But not forget to remove line with put(“password”, “password”) from your code.
Facebook returns error for this case.

Regards,
Kate.