Error 1001

Hi Backendlesses!
can’t seem to be able to update the current users’ properties.
I get an error 1001 with my code:
first I define the user variable :
BackendlessUser user = Backendless.UserService.CurrentUser();then in the ocCreate I define the backendless details: String appVersion = “v1”;
Backendless.initApp(this, “bla bla real number hidden”, “bla bla also hidden”, appVersion);
then I try to update in this methode:
public void userVpressed (View view){

user.setProperty(“about”, “a great guy”);
Backendless.UserService.update( user, new AsyncCallback<BackendlessUser>()
{
public void handleResponse( BackendlessUser user )
{
// user has been updated, return to user profile
Intent intent = new Intent( UserEditActivity.this, UserActivity.class );
startActivity( intent );
}
public void handleFault( BackendlessFault fault )
{
// user update failed, to get the error code call fault.getCode()
Toast.makeText(UserEditActivity.this, fault.getCode(), Toast.LENGTH_LONG).show();
}
});
}
I get an error 1001.
why ? what does it mean ?
thanks!

Do you call “initApp” after you got your user object?

I call initApp in my onCreate method abd my user in the public class:

public class UserEditActivity extends AppCompatActivity {

BackendlessUser user = Backendless.UserService.CurrentUser();


@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_user_edit);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    String appVersion = "v1";
    Backendless.initApp(this, "bla", "bla", appVersion);

Thanks. Do you compile against backendless.jar from maven or you downloaded it from our website?

I thank you.I’ve downloaded it from your website.

Here’s the code I just tried with the jar file from the SDK download available on the website right now. It works as expected. Could you try it with the same code? Make sure to change the email address and password in the login call:

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);




        Backendless.initApp(this, "my app id here", "my secret key", "v1");


        loginUser();
    }


    private void loginUser()
    {
        AsyncCallback&lt;BackendlessUser&gt; loginCallback = new AsyncCallback&lt;BackendlessUser&gt;() {
            @Override
            public void handleResponse(BackendlessUser backendlessUser) {
                Log.i( "MY APP", "User logged in" );
                updateCurrentUser();
            }


            @Override
            public void handleFault(BackendlessFault backendlessFault) {
                Log.e( "MY APP", backendlessFault.getMessage() );
            }
        };


        Backendless.UserService.login( "mark@backendless.com", "password", loginCallback );
    }


    private void updateCurrentUser()
    {
        AsyncCallback&lt;BackendlessUser&gt; updateCallback = new AsyncCallback&lt;BackendlessUser&gt;() {
            @Override
            public void handleResponse(BackendlessUser backendlessUser) {
                Log.i( "MY APP", "User has been updated" );
            }


            @Override
            public void handleFault(BackendlessFault backendlessFault) {
                Log.e( "MY APP", backendlessFault.getMessage() );
            }
        };
        BackendlessUser currentUser = Backendless.UserService.CurrentUser();
        currentUser.setProperty( "about", "a great guy" );
        Backendless.UserService.update( currentUser, updateCallback );
    }

Mark, thanks a lot, I’m using the easy facebook login so I don’t use the users’ email and password to login.

every time I login I need to use the facebook users’ email and password ? like in the line:

Backendless.UserService.login( "mark@backendless.com", "password", loginCallback );

Perhaps, that’s the reason for the error. I was testing with a user objects registered directly in Backendless (without Facebook login). Unfortunately, I do not my environment configured with a facebook app for testing. I will assign this to an engineer to investigate further.

Regards,
Mark

Thanks Mark.

just to be sure, when I use the facebook login, I don’t need to also use the users’ email and password in each activity in the app ? I only login once in my MainActivity into facebook and use the initApp in the other activities ?

No, you do not need to do that. It is either Facebook login method or Backendless login.

Thanks Mark.
So my problem is how to update the properties of a facebook login’ed user. Right now I get error 1001 that I don’t even know what it is.

And I’m not sure, do I need to put the initApp in every screen in the app ?

Gil,

it appears it is a bug on the server side. The bug is manifested only with the use-case when user is logged in with Facebook. As a workaround (just to get you going) you could create users with Backendless console and use the Backendless.UserService.login method (like in my example). Once the bug is fixed, you will switch back to Facebook.

Regards,
Mark

Thanks Mark.

Do you think that this bug also happens in twitter and google+ logins?

And can you estimate how long will it take to fix it? weeks, months?

it is possible that the bug applies to all social login forms. We cannot estimate until an engineer looks into the problem.

Ok. Please update about this bug.
Thanks for the help.

We will. It is in the workflow to update support topic when a fix is available.

Mark I have a theory.
I tried changing a users’ “about” property. Maybe it didn’t work because facebook uses the same Field in the graph API?
Can’t test it till tomorrow night though. At work.

Please let us know what you find out. Check with different property names…

Regards,
Mark

Sorry didn’t work.

Hi, Gil. There was an issue in Android SDK that is already fixed and is going through testing process.
We’ll notify you when it’s ready. Thanks for reporting!