mapping twiter user email

Hi

I’m trying to map my Twitter user’s email to my user object in Backendless. How to get the user email from twitter api in android, in my case it gives an error - “Validation for email property failed. Property value does not match the required pattern.”

The call I’m doing is the following.

Map<String, String> twitterFieldsMapping = new HashMap<>();
twitterFieldsMapping.put( “name”, “name” );
twitterFieldsMapping.put( “email”, “email” );

Backendless.UserService.loginWithTwitter( LoginActivity.this, twitterFieldsMapping, new SocialCallback<BackendlessUser>( LoginActivity.this )
{
@Override
public void handleResponse( BackendlessUser backendlessUser )
{
startActivity( new Intent( getBaseContext(), HomeActivity.class ) );
finish();
}
}, stayLoggedIn );

Did you establish any validators for user properties in Backendless?

Hi,

Did you get this to work? I’m having the same problem.

Same here:










    UserService -> onLogin: response = {

fault = "Validation for the email property failed. Property value does not match the required pattern.";

I used generated code, but I tried even to build it from scratch with same result.
Thing is that I found on twitter forum ,that email is now not provided during auth process and you have to have separate email permission in place, and after successful auth, you need to obtain it via twitter API. But this completely make easy login out of possibilities.

So can you provide example (functional one) how to auth + register via social services using backendless ?

use code generation example for twitter http://take.ms/ukjwC

I am using iOS, and yes i did exactly this with result i’ve posted

I have created investigation internal ticket BKNDLSS-13111

Yes, Twitter does not provide the user email, so easyLogin… method returns id instead email. You could save an email, provided by the user, in additional BackendlessUser property.

This is our sample project with easy Twitter login in attachment.

TestEasyTwitterLogin.zip (20.55MB)